diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 19e201183..c0ab01a09 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -96,7 +96,9 @@ class PageController extends Controller $book = $this->bookRepo->getBySlug($bookSlug); $page = $this->pageRepo->getBySlug($pageSlug, $book->id); $breadCrumbs = $this->pageRepo->getBreadCrumbs($page); - return view('pages/show', ['page' => $page, 'breadCrumbs' => $breadCrumbs, 'book' => $book]); + $sidebarBookTree = $this->bookRepo->getTree($book, $page->id); + //dd($sidebarBookTree); + return view('pages/show', ['page' => $page, 'breadCrumbs' => $breadCrumbs, 'book' => $book, 'sidebarBookTree' => $sidebarBookTree]); } /** diff --git a/app/Repos/BookRepo.php b/app/Repos/BookRepo.php index 060b6fc49..c43f449b0 100644 --- a/app/Repos/BookRepo.php +++ b/app/Repos/BookRepo.php @@ -53,10 +53,10 @@ class BookRepo $book->delete(); } - public function getTree($book) + public function getTree($book, $currentPageId = false) { $tree = $book->toArray(); - $tree['pages'] = $this->pageRepo->getTreeByBookId($book->id); + $tree['pages'] = $this->pageRepo->getTreeByBookId($book->id, $currentPageId); $tree['hasChildren'] = count($tree['pages']) > 0; return $tree; } diff --git a/app/Repos/PageRepo.php b/app/Repos/PageRepo.php index 05fe3f707..0e2f136be 100644 --- a/app/Repos/PageRepo.php +++ b/app/Repos/PageRepo.php @@ -102,7 +102,7 @@ class PageRepo $cPage['current'] = ($currentPageId !== false && $cPage['id'] === $currentPageId); $cPage['pages'] = []; foreach($page->children as $key => $childPage) { - $cPage['pages'][$key] = $this->toArrayTree($childPage); + $cPage['pages'][$key] = $this->toArrayTree($childPage, $currentPageId); } $cPage['hasChildren'] = count($cPage['pages']) > 0; return $cPage; diff --git a/resources/assets/sass/_forms.scss b/resources/assets/sass/_forms.scss index c2755efe3..5472e3053 100644 --- a/resources/assets/sass/_forms.scss +++ b/resources/assets/sass/_forms.scss @@ -52,6 +52,10 @@ input[type="text"], input[type="number"], input[type="email"], input[type="searc padding: $-xs $-s; } +.title-input .input { + width: 100%; +} + .title-input label, .description-input label{ margin-top: $-m; color: #666; @@ -61,6 +65,8 @@ input[type="text"], input[type="number"], input[type="email"], input[type="searc @extend h1; @extend .inline-input-style; margin-top: 0; + padding-right: 0; + width: 100%; color: #444; } diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index d083a9070..cf0649873 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -6,7 +6,11 @@ h1 { font-size: 3.625em; line-height: 1.22222222em; margin-top: 0.48888889em; - margin-bottom: 0.24444444em; + margin-bottom: 0.48888889em; + padding-bottom: 0.3333em; + border-bottom: 1px solid #EAEAEA; + //margin-left: -$-xxl; + //margin-right: -$-xxl; } h2 { font-size: 2.8275em; @@ -31,6 +35,7 @@ h1, h2, h3, h4 { font-weight: 500; position: relative; display: block; + color: #555; .subheader { display: block; font-size: 0.5em; diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 421686db0..b855a8067 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -10,52 +10,64 @@ @import "tinymce"; header { - background-color: #f8f8f8; display: block; - width: 100%; - position: fixed; z-index: 2; top: 0; - border-bottom: 1px solid #DDD; .padded { padding: $-m; } + //margin-bottom: $-l; } #sidebar { position: fixed; - background-color: #FFF; + background-color: #444; + color: #EEE; height: 100%; top: 0; z-index: 1; - padding-top: 63px + $-m; + //padding-top: $-m; width: 300px; border-right: 1px solid #DDD; + h4, li, p, a { + color: #CCC; + } } #content { - margin-top: 63px; + //margin-top: 63px; margin-left: 300px; display: block; position: relative; + padding: 0 16px; } .logo { - width: 180px; - opacity: 0.8; + font-size: 2em; + padding: $-xl $-s; + font-weight: bold; + color: #CCC; } -header hr { - margin-top: 0; +.search-box { + input { + width: 100%; + border-radius: 0; + padding: $-s $-m; + background-color: rgba(0, 0, 0, 0.1); + border: none; + border-top: 1px solid #333; + border-bottom: 1px solid #333; + } } -header .menu { - margin-bottom: 0; +ul.menu { list-style: none; - margin-left: 0; - li { - display: inline-block; - margin-right: $-m; + margin: 0; + li a { + padding: $-m; + display: block; + border-bottom: 1px solid #333; } } @@ -87,9 +99,6 @@ header .menu { &.left { float: left; } - h1 { - margin-top: 0.2em; - } } .page-list { @@ -103,22 +112,27 @@ header .menu { } } -.page-menu { - opacity: 0.6; - transition: opacity ease-in-out 120ms; - &:hover { - opacity: 1; - } - .buttons a { - display: block; - } +.side-nav { + position: fixed; + padding-left: $-m; + opacity: 0.8; + margin-top: $-xxl; + margin-left: 0; + max-width: 240px; } .page-nav-list { $nav-indent: $-s; + margin-left: 2px; + list-style: none; li { //border-left: 1px solid rgba(0, 0, 0, 0.1); padding-left: $-xs; + border-left: 2px solid #888; + margin-bottom: 4px; + } + li a { + color: #555; } .nav-H2 { margin-left: $nav-indent; @@ -229,10 +243,6 @@ h1, h2, h3, h4, h5, h6 { .breadcrumbs { margin-top: $-s; - a, span { - color: #666; - font-size: 0.9em; - } i { padding-right: 4px; } @@ -242,6 +252,30 @@ h1, h2, h3, h4, h5, h6 { } } +.faded { + opacity: 0.5; + transition: opacity ease-in-out 120ms; + &:hover { + opacity: 1; + } +} + +.faded-small { + color: #666; + font-size: 0.9em; + a, span { + color: #666; + } +} + +.action-buttons { + text-align: right; + a { + display: inline-block; + padding: $-s; + } +} + .nested-page-list { list-style: none; @@ -288,6 +322,25 @@ h1, h2, h3, h4, h5, h6 { } } +.book-tree h4 { + padding: $-m $-s 0 $-s; + i { + padding-right: $-s; + } +} +.book-tree .sidebar-page-list { + list-style: none; + margin: 0; + li a { + display: block; + padding: $-s $-m; + border-bottom: 2px dotted #333; + } + a.bold { + color: #EEE !important; + } +} + .sortable-page-list, .sortable-page-list ul { list-style: none; //background-color: rgba(0, 0, 0, 0.04); diff --git a/resources/views/base.blade.php b/resources/views/base.blade.php index bae7a4f2c..47c4a13d3 100644 --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@ -27,26 +27,23 @@
-