From 30d2edddda141d47a72aa9bb328302ef8d93b507 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 2 Sep 2015 14:39:54 +0100 Subject: [PATCH] Cleaned book-show page/chapter list design --- gulpfile.js | 2 +- .../js/{book-sidebar.js => book-dashboard.js} | 0 resources/assets/sass/styles.scss | 35 ++++++++++++++++--- resources/views/books/form.blade.php | 2 +- resources/views/books/show.blade.php | 6 ++-- resources/views/chapters/show.blade.php | 2 +- 6 files changed, 38 insertions(+), 9 deletions(-) rename resources/assets/js/{book-sidebar.js => book-dashboard.js} (100%) diff --git a/gulpfile.js b/gulpfile.js index 36693223d..7092e6ff8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,6 +14,6 @@ var elixir = require('laravel-elixir'); elixir(function(mix) { mix.sass('styles.scss'); mix.scripts('image-manager.js', 'public/js/image-manager.js'); - mix.scripts('book-sidebar.js', 'public/js/book-sidebar.js'); + mix.scripts('book-dashboard.js', 'public/js/book-dashboard.js'); mix.scripts('jquery-extensions.js', 'public/js/jquery-extensions.js'); }); diff --git a/resources/assets/js/book-sidebar.js b/resources/assets/js/book-dashboard.js similarity index 100% rename from resources/assets/js/book-sidebar.js rename to resources/assets/js/book-dashboard.js diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 665315287..2c3a70bcf 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -169,7 +169,7 @@ body.flexbox { .page-list { h3 { - margin: $-l 0; + margin: $-l 0 $-m 0; } a.chapter { color: $color-chapter; @@ -177,16 +177,43 @@ body.flexbox { .inset-list { display: block; overflow: hidden; - padding-left: $-l*2; - border-top: 3px dotted #EEE; + // padding-left: $-m; + margin-bottom: $-l; } h4 { display: block; - margin: $-m 0; + margin: $-s 0 0 0; + border-left: 5px solid $color-page; + padding: $-xs 0 $-xs $-m; } hr { margin-top: 0; } + .book-child { + padding-left: $-l; + &.page { + border-left: 5px solid $color-page; + } + &.chapter { + border-left: 5px solid $color-chapter; + } + } +} +.chapter-toggle { + cursor: pointer; + margin: 0 0 $-l 0; + transition: all ease-in-out 180ms; + i { + transition: all ease-in-out 180ms; + transform: rotate(0deg); + transform-origin: 25% 50%; + } + &.open { + margin-bottom: 0; + } + &.open i { + transform: rotate(90deg); + } } .side-nav { diff --git a/resources/views/books/form.blade.php b/resources/views/books/form.blade.php index 40a6d92cb..dc0fd0a3f 100644 --- a/resources/views/books/form.blade.php +++ b/resources/views/books/form.blade.php @@ -11,6 +11,6 @@
- Cancel + Cancel
\ No newline at end of file diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index 6e1aaf7b4..9d2841a22 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -39,10 +39,10 @@
@if(count($book->children()) > 0) @foreach($book->children() as $childElement) -
+

- {{ $childElement->name }} + {{ $childElement->name }}

@@ -50,6 +50,7 @@

@if($childElement->isA('chapter') && count($childElement->pages) > 0) +

{{ count($childElement->pages) }} Pages

@foreach($childElement->pages as $page)

{{$page->name}}

@@ -109,6 +110,7 @@ $('.chapter-toggle').click(function(e) { e.preventDefault(); + $(this).toggleClass('open'); $(this).closest('.book-child').find('.inset-list').slideToggle(180); }); diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php index 9eb27f225..bd61500aa 100644 --- a/resources/views/chapters/show.blade.php +++ b/resources/views/chapters/show.blade.php @@ -7,7 +7,7 @@