From 60d175a9b9ea6e64725ca89ef3f1b2afd3c51758 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 30 Mar 2019 15:15:01 +0000 Subject: [PATCH] Cleaned up sidebar book tree and moved details - Also made top-spacing more consistent --- resources/assets/sass/_components.scss | 7 +- resources/assets/sass/_lists.scss | 73 ++++++++++--------- resources/assets/sass/styles.scss | 6 -- resources/views/books/index.blade.php | 8 +- resources/views/books/list.blade.php | 2 +- resources/views/books/show.blade.php | 33 +++++---- resources/views/chapters/show.blade.php | 54 +++++++------- resources/views/pages/show.blade.php | 19 +++-- resources/views/partials/book-tree.blade.php | 22 ++++-- .../views/partials/breadcrumbs.blade.php | 11 ++- resources/views/shelves/list.blade.php | 3 +- resources/views/shelves/show.blade.php | 6 ++ 12 files changed, 138 insertions(+), 106 deletions(-) diff --git a/resources/assets/sass/_components.scss b/resources/assets/sass/_components.scss index 1f34166c6..9ebe5d0d7 100644 --- a/resources/assets/sass/_components.scss +++ b/resources/assets/sass/_components.scss @@ -54,13 +54,18 @@ transition: all ease-in-out 180ms; user-select: none; svg[data-icon="caret-right"] { + margin-right: 0; + font-size: 1rem; transition: all ease-in-out 180ms; transform: rotate(0deg); - transform-origin: 25% 50%; + transform-origin: 50% 50%; } &.open svg[data-icon="caret-right"] { transform: rotate(90deg); } + svg[data-icon="caret-right"] + * { + margin-left: $-xs; + } } [overlay] { diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index 74b0d9938..7182e8f7e 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -85,7 +85,7 @@ .sidebar-page-nav { $nav-indent: $-m; list-style: none; - margin: $-s 0 $-m 2px; + margin: $-s 0 $-m $-xs; position: relative; &:after { content: ''; @@ -140,61 +140,68 @@ } // Sidebar list -.book-tree .book.entity-list-item { - font-size: 0.6rem; - h4 { - font-size: 1rem; - margin: 0; - } -} -.book-tree .sidebar-page-list { +.book-tree .sidebar-page-list { list-style: none; - margin: $-xs 0 0; + margin: $-xs -$-s 0 -$-s; padding-left: 0; padding-right: 0; position: relative; + + &:after, .sub-menu:after { + content: ''; + display: block; + position: absolute; + left: $-m; + top: 1rem; + bottom: 1rem; + border-left: 4px solid rgba(0, 0, 0, 0.1); + z-index: 0; + } + ul { list-style: none; padding-left: 1rem; padding-right: 0; } - .entity-icon { - font-size: 12px; - z-index: 2; - background-color: #FFF; + .entity-list-item { + padding-top: $-xxs; + padding-bottom: $-xxs; + .content { + padding-top: $-xs; + padding-bottom: $-xs; + } + } + .entity-list-item.no-hover { + margin-top: -$-xs; + padding-right: 0; } .entity-list-item-name { font-size: 1em; margin: 0; } - .entity-list-item { - font-size: 0.8rem; - } - .entity-list-item.selected { - background-color: #F2F2F2; - } .chapter-child-menu { - font-size: 12px; - padding-left: 2rem; + font-size: .8rem; margin-top: -.2rem; + margin-left: -1rem; } [chapter-toggle] { padding-left: 1.5rem; padding-bottom: .2rem; } - .icon { + .entity-list-item .icon { z-index: 2; - } - &:after, .sub-menu:after { - content: ''; - display: block; - position: absolute; - left: 1.6rem; - top: 1rem; - bottom: 1rem; - border-left: 2px solid #DDD; + width: 4px; + height: auto; + align-self: stretch; + flex-shrink: 0; + border-radius: 1px; opacity: 0.6; - z-index: 0; + } + .entity-list-item .icon:after { + opacity: 1; + } + .entity-list-item .icon svg { + display: none; } } diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 7792aee83..df1132de5 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -212,12 +212,6 @@ $btt-size: 40px; } } -.entity-list-item.selected { - h3, i, p ,a, span { - color: #EEE; - } -} - .scroll-box { max-height: 250px; overflow-y: scroll; diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php index e106b3704..bdfe4a480 100644 --- a/resources/views/books/index.blade.php +++ b/resources/views/books/index.blade.php @@ -2,6 +2,10 @@ @section('container-classes', 'mt-xl') +@section('body') + @include('books.list', ['books' => $books, 'view' => $view]) +@stop + @section('left') @if($recents)
@@ -29,10 +33,6 @@
@stop -@section('body') - @include('books.list', ['books' => $books, 'view' => $view]) -@stop - @section('right')
diff --git a/resources/views/books/list.blade.php b/resources/views/books/list.blade.php index 6e0cc1fd6..91a2c716e 100644 --- a/resources/views/books/list.blade.php +++ b/resources/views/books/list.blade.php @@ -1,5 +1,5 @@ -
+

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

diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index 654bb98e3..04352d898 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -60,6 +60,23 @@ @section('right') +
+
{{ trans('common.details') }}
+ +
+ +
{{ trans('common.actions') }}
@@ -130,22 +147,6 @@
-
-
{{ trans('common.details') }}
- -
- @if(count($activity) > 0)
{{ trans('entities.recent_activity') }}
diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php index 2e2cead89..15ac6bc2b 100644 --- a/resources/views/chapters/show.blade.php +++ b/resources/views/chapters/show.blade.php @@ -58,6 +58,33 @@ @section('right') +
+
{{ trans('common.details') }}
+ +
+
{{ trans('common.actions') }}
@@ -139,33 +166,6 @@
-
-
{{ trans('common.details') }}
- -
- @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree]) @stop diff --git a/resources/views/pages/show.blade.php b/resources/views/pages/show.blade.php index 6858661c4..776182fa0 100644 --- a/resources/views/pages/show.blade.php +++ b/resources/views/pages/show.blade.php @@ -48,12 +48,15 @@ @endif @if ($page->attachments->count() > 0) -
+
{{ trans('entities.pages_attachments') }}
@endif + @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree]) +@stop + +@section('right')
{{ trans('common.details') }}
- - @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree]) -@stop - -@section('right')
Actions
diff --git a/resources/views/partials/book-tree.blade.php b/resources/views/partials/book-tree.blade.php index 360162b2f..73064dceb 100644 --- a/resources/views/partials/book-tree.blade.php +++ b/resources/views/partials/book-tree.blade.php @@ -1,19 +1,27 @@
{{ trans('entities.books_navigation') }}
- @if (userCan('view', $book)) -
- @include('partials.entity-list-item-basic', ['entity' => $book, 'classes' => ($current->matches($book)? 'selected' : '')]) -
- @endif -