]> BookStack Code Mirror - bookstack/commitdiff
Styles: Aligned empty state alignment & consistency
authorDan Brown <redacted>
Mon, 23 Oct 2023 10:53:19 +0000 (11:53 +0100)
committerDan Brown <redacted>
Mon, 23 Oct 2023 10:53:19 +0000 (11:53 +0100)
- Fixed inital empty state margins/paddings to be aligned and not differ
when lists are empty.
- Aligned button/action display when viewing empty entities.
- Fixed use of non-existing permission in books for book empty state
  button.

Fixes #4563

resources/sass/_blocks.scss
resources/sass/_lists.scss
resources/views/books/index.blade.php
resources/views/books/parts/list.blade.php
resources/views/common/activity-list.blade.php
resources/views/entities/list.blade.php
resources/views/home/default.blade.php
resources/views/shelves/index.blade.php
resources/views/shelves/parts/list.blade.php

index d63ed38025a4f315f9cbc3779be92ffc9d40ad7b..9e96e920b8d36164db59bad070059636f313d3e5 100644 (file)
@@ -8,7 +8,7 @@
   border-radius: 3px;
   break-inside: avoid;
   .body, p.empty-text {
-    padding: $-m;
+    padding-block: $-m;
   }
   a, p {
     word-wrap: break-word;
index 323551196585fbac2ec961016a53e7ba61a8e668..299bfbc335e22a57602b8ba7d9eef566ae3873fd 100644 (file)
@@ -342,7 +342,7 @@ details.sort-box[open] summary .caret-container svg {
   font-size: 0.9em;
 }
 .card .activity-list-item {
-  padding: $-s $-m;
+  padding-block: $-s;
 }
 
 .user-list-item {
index bf9795b3ae448b61e02b76f8ce7f7c06782143f7..0b407a8609abb98f3b6ae99d1bb4930b7ab8249f 100644 (file)
@@ -17,7 +17,7 @@
         @if(count($popular) > 0)
             @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
         @else
-            <div class="body text-muted">{{ trans('entities.books_popular_empty') }}</div>
+            <p class="text-muted pb-l mb-none">{{ trans('entities.books_popular_empty') }}</p>
         @endif
     </div>
 
@@ -26,7 +26,7 @@
         @if(count($popular) > 0)
             @include('entities.list', ['entities' => $new, 'style' => 'compact'])
         @else
-            <div class="body text-muted">{{ trans('entities.books_new_empty') }}</div>
+            <p class="text-muted pb-l mb-none">{{ trans('entities.books_new_empty') }}</p>
         @endif
     </div>
 @stop
@@ -36,7 +36,7 @@
     <div class="actions mb-xl">
         <h5>{{ trans('common.actions') }}</h5>
         <div class="icon-list text-link">
-            @if(user()->can('book-create-all'))
+            @if(userCan('book-create-all'))
                 <a href="{{ url("/create-book") }}" data-shortcut="new" class="icon-list-item">
                     <span>@icon('add')</span>
                     <span>{{ trans('entities.books_create') }}</span>
index 2cf83dfa91b6d55d16c6becd2435dbb5c0267480..8b658c711a13ca0c016c7ad50679bede0c875b78 100644 (file)
         </div>
     @else
         <p class="text-muted">{{ trans('entities.books_empty') }}</p>
-        @if(userCan('books-create-all'))
-            <a href="{{ url("/create-book") }}" class="text-pos">@icon('edit'){{ trans('entities.create_now') }}</a>
+        @if(userCan('book-create-all'))
+            <div class="icon-list block inline">
+                <a href="{{ url("/create-book") }}"
+                   class="icon-list-item text-book">
+                    <span>@icon('add')</span>
+                    <span>{{ trans('entities.create_now') }}</span>
+                </a>
+            </div>
         @endif
     @endif
 </main>
\ No newline at end of file
index 90272b21c6921ab8672bfa788f52b2aa09cd0641..bcaf2ac11b759b359457a25c5ab66a714fb9fbc2 100644 (file)
@@ -8,5 +8,5 @@
         @endforeach
     </div>
 @else
-    <p class="text-muted empty-text">{{ trans('common.no_activity') }}</p>
+    <p class="text-muted empty-text mb-none pb-l">{{ trans('common.no_activity') }}</p>
 @endif
\ No newline at end of file
index 25673c583baf4a2cbba4f743552d5373423d76db..a12a90878f22e6269325a30d9fadee7c9d8fa18d 100644 (file)
@@ -5,7 +5,7 @@
         @endforeach
     </div>
 @else
-    <p class="text-muted empty-text">
+    <p class="text-muted empty-text pb-l mb-none">
         {{ $emptyText ?? trans('common.no_items') }}
     </p>
 @endif
\ No newline at end of file
index 2d71e37f62172d77c694bfa1c245ef0a4b19457f..a546ddecacbd0bf13cfd9f8e3794bdb44f36fbfa 100644 (file)
                         'emptyText' => trans('entities.no_pages_recently_updated'),
                         ])
                     </div>
-                    <a href="{{ url("/pages/recently-updated") }}" class="card-footer-link">{{ trans('common.view_all') }}</a>
+                    @if(count($recentlyUpdatedPages) > 0)
+                        <a href="{{ url("/pages/recently-updated") }}" class="card-footer-link">{{ trans('common.view_all') }}</a>
+                    @endif
                 </div>
             </div>
 
             <div>
                 <div id="recent-activity" class="card mb-xl">
                     <h3 class="card-title">{{ trans('entities.recent_activity') }}</h3>
-                    @include('common.activity-list', ['activity' => $activity])
+                    <div class="px-m">
+                        @include('common.activity-list', ['activity' => $activity])
+                    </div>
                 </div>
             </div>
 
index eafc339ce9a5bfdcc9235d0c275e7bb180059e95..85663b413077e6483a94aaf8b1b81aa4a043df71 100644 (file)
@@ -40,7 +40,7 @@
         @if(count($popular) > 0)
             @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
         @else
-            <div class="text-muted">{{ trans('entities.shelves_popular_empty') }}</div>
+            <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_popular_empty') }}</p>
         @endif
     </div>
 
@@ -49,7 +49,7 @@
         @if(count($new) > 0)
             @include('entities.list', ['entities' => $new, 'style' => 'compact'])
         @else
-            <div class="text-muted">{{ trans('entities.shelves_new_empty') }}</div>
+            <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_new_empty') }}</p>
         @endif
     </div>
 @stop
\ No newline at end of file
index da9c06d9208a585224e823e3125fa0ad3c8759d5..7f6e02a8b7ce87ff8c6cd33b98dabd7ae1f75af1 100644 (file)
     @else
         <p class="text-muted">{{ trans('entities.shelves_empty') }}</p>
         @if(userCan('bookshelf-create-all'))
-            <a href="{{ url("/create-shelf") }}"
-               class="button outline">@icon('edit'){{ trans('entities.create_now') }}</a>
+            <div class="icon-list block inline">
+                <a href="{{ url("/create-shelf") }}"
+                   class="icon-list-item text-bookshelf">
+                    <span>@icon('add')</span>
+                    <span>{{ trans('entities.create_now') }}</span>
+                </a>
+            </div>
         @endif
     @endif