]> BookStack Code Mirror - bookstack/commitdiff
Changed homepage card header links to be bottom-card-links
authorDan Brown <redacted>
Tue, 23 Nov 2021 18:18:49 +0000 (18:18 +0000)
committerDan Brown <redacted>
Tue, 23 Nov 2021 18:18:49 +0000 (18:18 +0000)
The old links in the headers were not obvious. This changes the
header-based links to instead be a link at the bottom of the card.

Related to #3046

app/Http/Controllers/HomeController.php
resources/sass/_blocks.scss
resources/views/home/default.blade.php
resources/views/home/parts/sidebar.blade.php

index 5451c0abfe8289730e26649eec36c713aa3c5d36..df810a3cfe3b7d23e0ffb4532f9ab864b603e61f 100644 (file)
@@ -39,7 +39,7 @@ class HomeController extends Controller
         $recentlyUpdatedPages = Page::visible()->with('book')
             ->where('draft', false)
             ->orderBy('updated_at', 'desc')
-            ->take($favourites->count() > 0 ? 6 : 12)
+            ->take($favourites->count() > 0 ? 5 : 10)
             ->select(Page::$listAttributes)
             ->get();
 
index b7aea74523ec29e20af1c1ab5fedcf28ab0f7091..0a7a689f7dec53043ffbf576ba3c418f06eb6d43 100644 (file)
 .card-title a {
   line-height: 1;
 }
+.card-footer-link {
+  display: block;
+  padding: $-s $-m;
+  line-height: 1;
+  border-top: 1px solid;
+  @include lightDark(border-color, #DDD, #555);
+  border-radius: 0 0 3px 3px;
+  font-size: 0.9em;
+  margin-top: $-xs;
+  &:hover {
+    text-decoration: none;
+    @include lightDark(background-color, #f2f2f2, #2d2d2d);
+  }
+}
 
 .card.border-card {
   border: 1px solid #DDD;
index b8866526d3d21521f38f4024e3014316a38e98c2..f6a337e5054d4bd7b978fc08c626253270d278ed 100644 (file)
             <div>
                 @if(count($favourites) > 0)
                     <div id="top-favourites" class="card mb-xl">
-                        <h3 class="card-title">
-                            <a href="{{ url('/favourites') }}" class="no-color">{{ trans('entities.my_most_viewed_favourites') }}</a>
-                        </h3>
+                        <h3 class="card-title">{{ trans('entities.my_most_viewed_favourites') }}</h3>
                         <div class="px-m">
                             @include('entities.list', [
                             'entities' => $favourites,
                             'style' => 'compact',
                             ])
                         </div>
+                        <a href="{{ url('/favourites')  }}" class="card-footer-link">{{ trans('common.view_all') }}</a>
                     </div>
                 @endif
 
                 <div id="recent-pages" class="card mb-xl">
-                    <h3 class="card-title"><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
+                    <h3 class="card-title">{{ trans('entities.recently_updated_pages') }}</h3>
                     <div id="recently-updated-pages" class="px-m">
                         @include('entities.list', [
                         'entities' => $recentlyUpdatedPages,
                         'style' => 'compact',
-                        'emptyText' => trans('entities.no_pages_recently_updated')
+                        'emptyText' => trans('entities.no_pages_recently_updated'),
                         ])
                     </div>
+                    <a href="{{ url("/pages/recently-updated") }}" class="card-footer-link">{{ trans('common.view_all') }}</a>
                 </div>
             </div>
 
index 8dc8118f57f6cf4c12a0e8c11d41fe53b94014b0..78f7e7a808563c488117601d5f00b1253d368c14 100644 (file)
@@ -7,13 +7,12 @@
 
 @if(count($favourites) > 0)
     <div id="top-favourites" class="mb-xl">
-        <h5>
-            <a href="{{ url('/favourites') }}" class="no-color">{{ trans('entities.my_most_viewed_favourites') }}</a>
-        </h5>
+        <h5>{{ trans('entities.my_most_viewed_favourites') }}</h5>
         @include('entities.list', [
             'entities' => $favourites,
             'style' => 'compact',
         ])
+        <a href="{{ url('/favourites')  }}" class="text-muted block py-xs">{{ trans('common.view_all') }}</a>
     </div>
 @endif
 
@@ -27,7 +26,7 @@
 </div>
 
 <div class="mb-xl">
-    <h5><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h5>
+    <h5>{{ trans('entities.recently_updated_pages') }}</h5>
     <div id="recently-updated-pages">
         @include('entities.list', [
         'entities' => $recentlyUpdatedPages,
@@ -35,6 +34,7 @@
         'emptyText' => trans('entities.no_pages_recently_updated')
         ])
     </div>
+    <a href="{{ url('/pages/recently-updated')  }}" class="text-muted block py-xs">{{ trans('common.view_all') }}</a>
 </div>
 
 <div id="recent-activity" class="mb-xl">