From 197caddf96b3d9ce6073109cfc2289133dd456f9 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 23 Nov 2021 18:18:49 +0000 Subject: [PATCH] Changed homepage card header links to be bottom-card-links 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 | 2 +- resources/sass/_blocks.scss | 14 ++++++++++++++ resources/views/home/default.blade.php | 10 +++++----- resources/views/home/parts/sidebar.blade.php | 8 ++++---- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 5451c0abf..df810a3cf 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -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(); diff --git a/resources/sass/_blocks.scss b/resources/sass/_blocks.scss index b7aea7452..0a7a689f7 100644 --- a/resources/sass/_blocks.scss +++ b/resources/sass/_blocks.scss @@ -87,6 +87,20 @@ .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; diff --git a/resources/views/home/default.blade.php b/resources/views/home/default.blade.php index b8866526d..f6a337e50 100644 --- a/resources/views/home/default.blade.php +++ b/resources/views/home/default.blade.php @@ -44,27 +44,27 @@
@if(count($favourites) > 0)
-

- {{ trans('entities.my_most_viewed_favourites') }} -

+

{{ trans('entities.my_most_viewed_favourites') }}

@include('entities.list', [ 'entities' => $favourites, 'style' => 'compact', ])
+ {{ trans('common.view_all') }}
@endif
-

{{ trans('entities.recently_updated_pages') }}

+

{{ trans('entities.recently_updated_pages') }}

@include('entities.list', [ 'entities' => $recentlyUpdatedPages, 'style' => 'compact', - 'emptyText' => trans('entities.no_pages_recently_updated') + 'emptyText' => trans('entities.no_pages_recently_updated'), ])
+ {{ trans('common.view_all') }}
diff --git a/resources/views/home/parts/sidebar.blade.php b/resources/views/home/parts/sidebar.blade.php index 8dc8118f5..78f7e7a80 100644 --- a/resources/views/home/parts/sidebar.blade.php +++ b/resources/views/home/parts/sidebar.blade.php @@ -7,13 +7,12 @@ @if(count($favourites) > 0)
-
- {{ trans('entities.my_most_viewed_favourites') }} -
+
{{ trans('entities.my_most_viewed_favourites') }}
@include('entities.list', [ 'entities' => $favourites, 'style' => 'compact', ]) + {{ trans('common.view_all') }}
@endif @@ -27,7 +26,7 @@
-
{{ trans('entities.recently_updated_pages') }}
+
{{ trans('entities.recently_updated_pages') }}
@include('entities.list', [ 'entities' => $recentlyUpdatedPages, @@ -35,6 +34,7 @@ 'emptyText' => trans('entities.no_pages_recently_updated') ])
+ {{ trans('common.view_all') }}