Added page navigation and tweaked header styles
Changed header selection in editor to be more descriptive and to provide a wider range of styles. Closes #68
Showing
11 changed files
with
145 additions
and
88 deletions
| ... | @@ -42,7 +42,7 @@ class PageController extends Controller | ... | @@ -42,7 +42,7 @@ class PageController extends Controller |
| 42 | 42 | ||
| 43 | /** | 43 | /** |
| 44 | * Show the form for creating a new page. | 44 | * Show the form for creating a new page. |
| 45 | - * @param $bookSlug | 45 | + * @param string $bookSlug |
| 46 | * @param bool $chapterSlug | 46 | * @param bool $chapterSlug |
| 47 | * @return Response | 47 | * @return Response |
| 48 | * @internal param bool $pageSlug | 48 | * @internal param bool $pageSlug |
| ... | @@ -61,8 +61,8 @@ class PageController extends Controller | ... | @@ -61,8 +61,8 @@ class PageController extends Controller |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
| 63 | * Show form to continue editing a draft page. | 63 | * Show form to continue editing a draft page. |
| 64 | - * @param $bookSlug | 64 | + * @param string $bookSlug |
| 65 | - * @param $pageId | 65 | + * @param int $pageId |
| 66 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | 66 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
| 67 | */ | 67 | */ |
| 68 | public function editDraft($bookSlug, $pageId) | 68 | public function editDraft($bookSlug, $pageId) |
| ... | @@ -112,8 +112,8 @@ class PageController extends Controller | ... | @@ -112,8 +112,8 @@ class PageController extends Controller |
| 112 | * Display the specified page. | 112 | * Display the specified page. |
| 113 | * If the page is not found via the slug the | 113 | * If the page is not found via the slug the |
| 114 | * revisions are searched for a match. | 114 | * revisions are searched for a match. |
| 115 | - * @param $bookSlug | 115 | + * @param string $bookSlug |
| 116 | - * @param $pageSlug | 116 | + * @param string $pageSlug |
| 117 | * @return Response | 117 | * @return Response |
| 118 | */ | 118 | */ |
| 119 | public function show($bookSlug, $pageSlug) | 119 | public function show($bookSlug, $pageSlug) |
| ... | @@ -131,14 +131,17 @@ class PageController extends Controller | ... | @@ -131,14 +131,17 @@ class PageController extends Controller |
| 131 | $this->checkOwnablePermission('page-view', $page); | 131 | $this->checkOwnablePermission('page-view', $page); |
| 132 | 132 | ||
| 133 | $sidebarTree = $this->bookRepo->getChildren($book); | 133 | $sidebarTree = $this->bookRepo->getChildren($book); |
| 134 | + $pageNav = $this->pageRepo->getPageNav($page); | ||
| 135 | + | ||
| 134 | Views::add($page); | 136 | Views::add($page); |
| 135 | $this->setPageTitle($page->getShortName()); | 137 | $this->setPageTitle($page->getShortName()); |
| 136 | - return view('pages/show', ['page' => $page, 'book' => $book, 'current' => $page, 'sidebarTree' => $sidebarTree]); | 138 | + return view('pages/show', ['page' => $page, 'book' => $book, |
| 139 | + 'current' => $page, 'sidebarTree' => $sidebarTree, 'pageNav' => $pageNav]); | ||
| 137 | } | 140 | } |
| 138 | 141 | ||
| 139 | /** | 142 | /** |
| 140 | * Get page from an ajax request. | 143 | * Get page from an ajax request. |
| 141 | - * @param $pageId | 144 | + * @param int $pageId |
| 142 | * @return \Illuminate\Http\JsonResponse | 145 | * @return \Illuminate\Http\JsonResponse |
| 143 | */ | 146 | */ |
| 144 | public function getPageAjax($pageId) | 147 | public function getPageAjax($pageId) |
| ... | @@ -149,8 +152,8 @@ class PageController extends Controller | ... | @@ -149,8 +152,8 @@ class PageController extends Controller |
| 149 | 152 | ||
| 150 | /** | 153 | /** |
| 151 | * Show the form for editing the specified page. | 154 | * Show the form for editing the specified page. |
| 152 | - * @param $bookSlug | 155 | + * @param string $bookSlug |
| 153 | - * @param $pageSlug | 156 | + * @param string $pageSlug |
| 154 | * @return Response | 157 | * @return Response |
| 155 | */ | 158 | */ |
| 156 | public function edit($bookSlug, $pageSlug) | 159 | public function edit($bookSlug, $pageSlug) |
| ... | @@ -185,8 +188,8 @@ class PageController extends Controller | ... | @@ -185,8 +188,8 @@ class PageController extends Controller |
| 185 | /** | 188 | /** |
| 186 | * Update the specified page in storage. | 189 | * Update the specified page in storage. |
| 187 | * @param Request $request | 190 | * @param Request $request |
| 188 | - * @param $bookSlug | 191 | + * @param string $bookSlug |
| 189 | - * @param $pageSlug | 192 | + * @param string $pageSlug |
| 190 | * @return Response | 193 | * @return Response |
| 191 | */ | 194 | */ |
| 192 | public function update(Request $request, $bookSlug, $pageSlug) | 195 | public function update(Request $request, $bookSlug, $pageSlug) |
| ... | @@ -205,7 +208,7 @@ class PageController extends Controller | ... | @@ -205,7 +208,7 @@ class PageController extends Controller |
| 205 | /** | 208 | /** |
| 206 | * Save a draft update as a revision. | 209 | * Save a draft update as a revision. |
| 207 | * @param Request $request | 210 | * @param Request $request |
| 208 | - * @param $pageId | 211 | + * @param int $pageId |
| 209 | * @return \Illuminate\Http\JsonResponse | 212 | * @return \Illuminate\Http\JsonResponse |
| 210 | */ | 213 | */ |
| 211 | public function saveDraft(Request $request, $pageId) | 214 | public function saveDraft(Request $request, $pageId) |
| ... | @@ -230,7 +233,7 @@ class PageController extends Controller | ... | @@ -230,7 +233,7 @@ class PageController extends Controller |
| 230 | /** | 233 | /** |
| 231 | * Redirect from a special link url which | 234 | * Redirect from a special link url which |
| 232 | * uses the page id rather than the name. | 235 | * uses the page id rather than the name. |
| 233 | - * @param $pageId | 236 | + * @param int $pageId |
| 234 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | 237 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 235 | */ | 238 | */ |
| 236 | public function redirectFromLink($pageId) | 239 | public function redirectFromLink($pageId) |
| ... | @@ -241,8 +244,8 @@ class PageController extends Controller | ... | @@ -241,8 +244,8 @@ class PageController extends Controller |
| 241 | 244 | ||
| 242 | /** | 245 | /** |
| 243 | * Show the deletion page for the specified page. | 246 | * Show the deletion page for the specified page. |
| 244 | - * @param $bookSlug | 247 | + * @param string $bookSlug |
| 245 | - * @param $pageSlug | 248 | + * @param string $pageSlug |
| 246 | * @return \Illuminate\View\View | 249 | * @return \Illuminate\View\View |
| 247 | */ | 250 | */ |
| 248 | public function showDelete($bookSlug, $pageSlug) | 251 | public function showDelete($bookSlug, $pageSlug) |
| ... | @@ -257,8 +260,8 @@ class PageController extends Controller | ... | @@ -257,8 +260,8 @@ class PageController extends Controller |
| 257 | 260 | ||
| 258 | /** | 261 | /** |
| 259 | * Show the deletion page for the specified page. | 262 | * Show the deletion page for the specified page. |
| 260 | - * @param $bookSlug | 263 | + * @param string $bookSlug |
| 261 | - * @param $pageId | 264 | + * @param int $pageId |
| 262 | * @return \Illuminate\View\View | 265 | * @return \Illuminate\View\View |
| 263 | * @throws NotFoundException | 266 | * @throws NotFoundException |
| 264 | */ | 267 | */ |
| ... | @@ -273,8 +276,8 @@ class PageController extends Controller | ... | @@ -273,8 +276,8 @@ class PageController extends Controller |
| 273 | 276 | ||
| 274 | /** | 277 | /** |
| 275 | * Remove the specified page from storage. | 278 | * Remove the specified page from storage. |
| 276 | - * @param $bookSlug | 279 | + * @param string $bookSlug |
| 277 | - * @param $pageSlug | 280 | + * @param string $pageSlug |
| 278 | * @return Response | 281 | * @return Response |
| 279 | * @internal param int $id | 282 | * @internal param int $id |
| 280 | */ | 283 | */ |
| ... | @@ -291,8 +294,8 @@ class PageController extends Controller | ... | @@ -291,8 +294,8 @@ class PageController extends Controller |
| 291 | 294 | ||
| 292 | /** | 295 | /** |
| 293 | * Remove the specified draft page from storage. | 296 | * Remove the specified draft page from storage. |
| 294 | - * @param $bookSlug | 297 | + * @param string $bookSlug |
| 295 | - * @param $pageId | 298 | + * @param int $pageId |
| 296 | * @return Response | 299 | * @return Response |
| 297 | * @throws NotFoundException | 300 | * @throws NotFoundException |
| 298 | */ | 301 | */ |
| ... | @@ -308,8 +311,8 @@ class PageController extends Controller | ... | @@ -308,8 +311,8 @@ class PageController extends Controller |
| 308 | 311 | ||
| 309 | /** | 312 | /** |
| 310 | * Shows the last revisions for this page. | 313 | * Shows the last revisions for this page. |
| 311 | - * @param $bookSlug | 314 | + * @param string $bookSlug |
| 312 | - * @param $pageSlug | 315 | + * @param string $pageSlug |
| 313 | * @return \Illuminate\View\View | 316 | * @return \Illuminate\View\View |
| 314 | */ | 317 | */ |
| 315 | public function showRevisions($bookSlug, $pageSlug) | 318 | public function showRevisions($bookSlug, $pageSlug) |
| ... | @@ -322,9 +325,9 @@ class PageController extends Controller | ... | @@ -322,9 +325,9 @@ class PageController extends Controller |
| 322 | 325 | ||
| 323 | /** | 326 | /** |
| 324 | * Shows a preview of a single revision | 327 | * Shows a preview of a single revision |
| 325 | - * @param $bookSlug | 328 | + * @param string $bookSlug |
| 326 | - * @param $pageSlug | 329 | + * @param string $pageSlug |
| 327 | - * @param $revisionId | 330 | + * @param int $revisionId |
| 328 | * @return \Illuminate\View\View | 331 | * @return \Illuminate\View\View |
| 329 | */ | 332 | */ |
| 330 | public function showRevision($bookSlug, $pageSlug, $revisionId) | 333 | public function showRevision($bookSlug, $pageSlug, $revisionId) |
| ... | @@ -339,9 +342,9 @@ class PageController extends Controller | ... | @@ -339,9 +342,9 @@ class PageController extends Controller |
| 339 | 342 | ||
| 340 | /** | 343 | /** |
| 341 | * Restores a page using the content of the specified revision. | 344 | * Restores a page using the content of the specified revision. |
| 342 | - * @param $bookSlug | 345 | + * @param string $bookSlug |
| 343 | - * @param $pageSlug | 346 | + * @param string $pageSlug |
| 344 | - * @param $revisionId | 347 | + * @param int $revisionId |
| 345 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | 348 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 346 | */ | 349 | */ |
| 347 | public function restoreRevision($bookSlug, $pageSlug, $revisionId) | 350 | public function restoreRevision($bookSlug, $pageSlug, $revisionId) |
| ... | @@ -357,8 +360,8 @@ class PageController extends Controller | ... | @@ -357,8 +360,8 @@ class PageController extends Controller |
| 357 | /** | 360 | /** |
| 358 | * Exports a page to pdf format using barryvdh/laravel-dompdf wrapper. | 361 | * Exports a page to pdf format using barryvdh/laravel-dompdf wrapper. |
| 359 | * https://github.com/barryvdh/laravel-dompdf | 362 | * https://github.com/barryvdh/laravel-dompdf |
| 360 | - * @param $bookSlug | 363 | + * @param string $bookSlug |
| 361 | - * @param $pageSlug | 364 | + * @param string $pageSlug |
| 362 | * @return \Illuminate\Http\Response | 365 | * @return \Illuminate\Http\Response |
| 363 | */ | 366 | */ |
| 364 | public function exportPdf($bookSlug, $pageSlug) | 367 | public function exportPdf($bookSlug, $pageSlug) |
| ... | @@ -374,8 +377,8 @@ class PageController extends Controller | ... | @@ -374,8 +377,8 @@ class PageController extends Controller |
| 374 | 377 | ||
| 375 | /** | 378 | /** |
| 376 | * Export a page to a self-contained HTML file. | 379 | * Export a page to a self-contained HTML file. |
| 377 | - * @param $bookSlug | 380 | + * @param string $bookSlug |
| 378 | - * @param $pageSlug | 381 | + * @param string $pageSlug |
| 379 | * @return \Illuminate\Http\Response | 382 | * @return \Illuminate\Http\Response |
| 380 | */ | 383 | */ |
| 381 | public function exportHtml($bookSlug, $pageSlug) | 384 | public function exportHtml($bookSlug, $pageSlug) |
| ... | @@ -391,8 +394,8 @@ class PageController extends Controller | ... | @@ -391,8 +394,8 @@ class PageController extends Controller |
| 391 | 394 | ||
| 392 | /** | 395 | /** |
| 393 | * Export a page to a simple plaintext .txt file. | 396 | * Export a page to a simple plaintext .txt file. |
| 394 | - * @param $bookSlug | 397 | + * @param string $bookSlug |
| 395 | - * @param $pageSlug | 398 | + * @param string $pageSlug |
| 396 | * @return \Illuminate\Http\Response | 399 | * @return \Illuminate\Http\Response |
| 397 | */ | 400 | */ |
| 398 | public function exportPlainText($bookSlug, $pageSlug) | 401 | public function exportPlainText($bookSlug, $pageSlug) |
| ... | @@ -434,8 +437,8 @@ class PageController extends Controller | ... | @@ -434,8 +437,8 @@ class PageController extends Controller |
| 434 | 437 | ||
| 435 | /** | 438 | /** |
| 436 | * Show the Restrictions view. | 439 | * Show the Restrictions view. |
| 437 | - * @param $bookSlug | 440 | + * @param string $bookSlug |
| 438 | - * @param $pageSlug | 441 | + * @param string $pageSlug |
| 439 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | 442 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
| 440 | */ | 443 | */ |
| 441 | public function showRestrict($bookSlug, $pageSlug) | 444 | public function showRestrict($bookSlug, $pageSlug) |
| ... | @@ -452,8 +455,8 @@ class PageController extends Controller | ... | @@ -452,8 +455,8 @@ class PageController extends Controller |
| 452 | 455 | ||
| 453 | /** | 456 | /** |
| 454 | * Show the view to choose a new parent to move a page into. | 457 | * Show the view to choose a new parent to move a page into. |
| 455 | - * @param $bookSlug | 458 | + * @param string $bookSlug |
| 456 | - * @param $pageSlug | 459 | + * @param string $pageSlug |
| 457 | * @return mixed | 460 | * @return mixed |
| 458 | * @throws NotFoundException | 461 | * @throws NotFoundException |
| 459 | */ | 462 | */ |
| ... | @@ -470,8 +473,8 @@ class PageController extends Controller | ... | @@ -470,8 +473,8 @@ class PageController extends Controller |
| 470 | 473 | ||
| 471 | /** | 474 | /** |
| 472 | * Does the action of moving the location of a page | 475 | * Does the action of moving the location of a page |
| 473 | - * @param $bookSlug | 476 | + * @param string $bookSlug |
| 474 | - * @param $pageSlug | 477 | + * @param string $pageSlug |
| 475 | * @param Request $request | 478 | * @param Request $request |
| 476 | * @return mixed | 479 | * @return mixed |
| 477 | * @throws NotFoundException | 480 | * @throws NotFoundException |
| ... | @@ -513,8 +516,8 @@ class PageController extends Controller | ... | @@ -513,8 +516,8 @@ class PageController extends Controller |
| 513 | 516 | ||
| 514 | /** | 517 | /** |
| 515 | * Set the permissions for this page. | 518 | * Set the permissions for this page. |
| 516 | - * @param $bookSlug | 519 | + * @param string $bookSlug |
| 517 | - * @param $pageSlug | 520 | + * @param string $pageSlug |
| 518 | * @param Request $request | 521 | * @param Request $request |
| 519 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | 522 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 520 | */ | 523 | */ | ... | ... |
| ... | @@ -7,6 +7,7 @@ use BookStack\Entity; | ... | @@ -7,6 +7,7 @@ use BookStack\Entity; |
| 7 | use BookStack\Exceptions\NotFoundException; | 7 | use BookStack\Exceptions\NotFoundException; |
| 8 | use Carbon\Carbon; | 8 | use Carbon\Carbon; |
| 9 | use DOMDocument; | 9 | use DOMDocument; |
| 10 | +use DOMXPath; | ||
| 10 | use Illuminate\Support\Str; | 11 | use Illuminate\Support\Str; |
| 11 | use BookStack\Page; | 12 | use BookStack\Page; |
| 12 | use BookStack\PageRevision; | 13 | use BookStack\PageRevision; |
| ... | @@ -159,6 +160,35 @@ class PageRepo extends EntityRepo | ... | @@ -159,6 +160,35 @@ class PageRepo extends EntityRepo |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | /** | 162 | /** |
| 163 | + * Parse te headers on the page to get a navigation menu | ||
| 164 | + * @param Page $page | ||
| 165 | + * @return array | ||
| 166 | + */ | ||
| 167 | + public function getPageNav(Page $page) | ||
| 168 | + { | ||
| 169 | + if ($page->html == '') return null; | ||
| 170 | + libxml_use_internal_errors(true); | ||
| 171 | + $doc = new DOMDocument(); | ||
| 172 | + $doc->loadHTML(mb_convert_encoding($page->html, 'HTML-ENTITIES', 'UTF-8')); | ||
| 173 | + $xPath = new DOMXPath($doc); | ||
| 174 | + $headers = $xPath->query("//h1|//h2|//h3|//h4|//h5|//h6"); | ||
| 175 | + | ||
| 176 | + if (is_null($headers)) return null; | ||
| 177 | + | ||
| 178 | + $tree = []; | ||
| 179 | + foreach ($headers as $header) { | ||
| 180 | + $text = $header->nodeValue; | ||
| 181 | + $tree[] = [ | ||
| 182 | + 'nodeName' => strtolower($header->nodeName), | ||
| 183 | + 'level' => intval(str_replace('h', '', $header->nodeName)), | ||
| 184 | + 'link' => '#' . $header->getAttribute('id'), | ||
| 185 | + 'text' => strlen($text) > 30 ? substr($text, 0, 27) . '...' : $text | ||
| 186 | + ]; | ||
| 187 | + } | ||
| 188 | + return $tree; | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + /** | ||
| 162 | * Formats a page's html to be tagged correctly | 192 | * Formats a page's html to be tagged correctly |
| 163 | * within the system. | 193 | * within the system. |
| 164 | * @param string $htmlText | 194 | * @param string $htmlText | ... | ... |
| ... | @@ -81,9 +81,10 @@ var mceOptions = module.exports = { | ... | @@ -81,9 +81,10 @@ var mceOptions = module.exports = { |
| 81 | toolbar: "undo redo | styleselect | bold italic underline strikethrough superscript subscript | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image-insert link hr | removeformat code fullscreen", | 81 | toolbar: "undo redo | styleselect | bold italic underline strikethrough superscript subscript | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image-insert link hr | removeformat code fullscreen", |
| 82 | content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important; margin-left:auto!important;margin-right:auto!important;}", | 82 | content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important; margin-left:auto!important;margin-right:auto!important;}", |
| 83 | style_formats: [ | 83 | style_formats: [ |
| 84 | - {title: "Header 1", format: "h1"}, | 84 | + {title: "Header Large", format: "h2"}, |
| 85 | - {title: "Header 2", format: "h2"}, | 85 | + {title: "Header Medium", format: "h3"}, |
| 86 | - {title: "Header 3", format: "h3"}, | 86 | + {title: "Header Small", format: "h4"}, |
| 87 | + {title: "Header Tiny", format: "h5"}, | ||
| 87 | {title: "Paragraph", format: "p", exact: true, classes: ''}, | 88 | {title: "Paragraph", format: "p", exact: true, classes: ''}, |
| 88 | {title: "Blockquote", format: "blockquote"}, | 89 | {title: "Blockquote", format: "blockquote"}, |
| 89 | {title: "Code Block", icon: "code", format: "pre"}, | 90 | {title: "Code Block", icon: "code", format: "pre"}, | ... | ... |
| 1 | .page-list { | 1 | .page-list { |
| 2 | - h3 { | 2 | + h4 { |
| 3 | margin: $-l 0 $-xs 0; | 3 | margin: $-l 0 $-xs 0; |
| 4 | font-size: 1.666em; | 4 | font-size: 1.666em; |
| 5 | } | 5 | } |
| ... | @@ -11,11 +11,13 @@ | ... | @@ -11,11 +11,13 @@ |
| 11 | overflow: hidden; | 11 | overflow: hidden; |
| 12 | margin-bottom: $-l; | 12 | margin-bottom: $-l; |
| 13 | } | 13 | } |
| 14 | - h4 { | 14 | + h5 { |
| 15 | display: block; | 15 | display: block; |
| 16 | margin: $-s 0 0 0; | 16 | margin: $-s 0 0 0; |
| 17 | border-left: 5px solid $color-page; | 17 | border-left: 5px solid $color-page; |
| 18 | padding: $-xs 0 $-xs $-m; | 18 | padding: $-xs 0 $-xs $-m; |
| 19 | + font-size: 1.1em; | ||
| 20 | + font-weight: normal; | ||
| 19 | &.draft { | 21 | &.draft { |
| 20 | border-left-color: $color-page-draft; | 22 | border-left-color: $color-page-draft; |
| 21 | } | 23 | } |
| ... | @@ -67,44 +69,39 @@ | ... | @@ -67,44 +69,39 @@ |
| 67 | } | 69 | } |
| 68 | } | 70 | } |
| 69 | 71 | ||
| 70 | -.page-nav-list { | 72 | +.sidebar-page-nav { |
| 71 | $nav-indent: $-s; | 73 | $nav-indent: $-s; |
| 72 | - margin-left: 2px; | ||
| 73 | list-style: none; | 74 | list-style: none; |
| 75 | + margin: $-s 0 $-m 2px; | ||
| 76 | + border-left: 2px dotted #BBB; | ||
| 74 | li { | 77 | li { |
| 75 | - //border-left: 1px solid rgba(0, 0, 0, 0.1); | 78 | + padding-left: $-s; |
| 76 | - padding-left: $-xs; | ||
| 77 | - border-left: 2px solid #888; | ||
| 78 | margin-bottom: 4px; | 79 | margin-bottom: 4px; |
| 80 | + font-size: 0.95em; | ||
| 79 | } | 81 | } |
| 80 | - li a { | 82 | + .h1 { |
| 81 | - color: #555; | 83 | + margin-left: -2px; |
| 82 | } | 84 | } |
| 83 | - .nav-H2 { | 85 | + .h2 { |
| 86 | + margin-left: -2px; | ||
| 87 | + } | ||
| 88 | + .h3 { | ||
| 84 | margin-left: $nav-indent; | 89 | margin-left: $nav-indent; |
| 85 | - font-size: 0.95em; | ||
| 86 | } | 90 | } |
| 87 | - .nav-H3 { | 91 | + .h4 { |
| 88 | margin-left: $nav-indent*2; | 92 | margin-left: $nav-indent*2; |
| 89 | - font-size: 0.90em | ||
| 90 | } | 93 | } |
| 91 | - .nav-H4 { | 94 | + .h5 { |
| 92 | margin-left: $nav-indent*3; | 95 | margin-left: $nav-indent*3; |
| 93 | - font-size: 0.85em | ||
| 94 | } | 96 | } |
| 95 | - .nav-H5 { | 97 | + .h6 { |
| 96 | margin-left: $nav-indent*4; | 98 | margin-left: $nav-indent*4; |
| 97 | - font-size: 0.80em | ||
| 98 | - } | ||
| 99 | - .nav-H6 { | ||
| 100 | - margin-left: $nav-indent*5; | ||
| 101 | - font-size: 0.75em | ||
| 102 | } | 99 | } |
| 103 | } | 100 | } |
| 104 | 101 | ||
| 105 | // Sidebar list | 102 | // Sidebar list |
| 106 | .book-tree { | 103 | .book-tree { |
| 107 | - padding: $-l 0 0 0; | 104 | + padding: $-xs 0 0 0; |
| 108 | position: relative; | 105 | position: relative; |
| 109 | right: 0; | 106 | right: 0; |
| 110 | top: 0; | 107 | top: 0; |
| ... | @@ -306,10 +303,10 @@ ul.pagination { | ... | @@ -306,10 +303,10 @@ ul.pagination { |
| 306 | } | 303 | } |
| 307 | 304 | ||
| 308 | .entity-list { | 305 | .entity-list { |
| 309 | - >div { | 306 | + > div { |
| 310 | padding: $-m 0; | 307 | padding: $-m 0; |
| 311 | } | 308 | } |
| 312 | - h3 { | 309 | + h4 { |
| 313 | margin: 0; | 310 | margin: 0; |
| 314 | } | 311 | } |
| 315 | p { | 312 | p { |
| ... | @@ -327,9 +324,10 @@ ul.pagination { | ... | @@ -327,9 +324,10 @@ ul.pagination { |
| 327 | color: $color-page-draft; | 324 | color: $color-page-draft; |
| 328 | } | 325 | } |
| 329 | } | 326 | } |
| 327 | + | ||
| 330 | .entity-list.compact { | 328 | .entity-list.compact { |
| 331 | font-size: 0.6em; | 329 | font-size: 0.6em; |
| 332 | - h3, a { | 330 | + h4, a { |
| 333 | line-height: 1.2; | 331 | line-height: 1.2; |
| 334 | } | 332 | } |
| 335 | p { | 333 | p { | ... | ... |
| ... | @@ -15,31 +15,41 @@ h2 { | ... | @@ -15,31 +15,41 @@ h2 { |
| 15 | margin-bottom: 0.43137255em; | 15 | margin-bottom: 0.43137255em; |
| 16 | } | 16 | } |
| 17 | h3 { | 17 | h3 { |
| 18 | - font-size: 1.75em; | 18 | + font-size: 2.333em; |
| 19 | line-height: 1.571428572em; | 19 | line-height: 1.571428572em; |
| 20 | margin-top: 0.78571429em; | 20 | margin-top: 0.78571429em; |
| 21 | margin-bottom: 0.43137255em; | 21 | margin-bottom: 0.43137255em; |
| 22 | } | 22 | } |
| 23 | h4 { | 23 | h4 { |
| 24 | - font-size: 1em; | 24 | + font-size: 1.666em; |
| 25 | line-height: 1.375em; | 25 | line-height: 1.375em; |
| 26 | margin-top: 0.78571429em; | 26 | margin-top: 0.78571429em; |
| 27 | margin-bottom: 0.43137255em; | 27 | margin-bottom: 0.43137255em; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | -h1, h2, h3, h4 { | 30 | +h1, h2, h3, h4, h5, h6 { |
| 31 | font-weight: 400; | 31 | font-weight: 400; |
| 32 | position: relative; | 32 | position: relative; |
| 33 | display: block; | 33 | display: block; |
| 34 | color: #555; | 34 | color: #555; |
| 35 | .subheader { | 35 | .subheader { |
| 36 | - //display: block; | ||
| 37 | font-size: 0.5em; | 36 | font-size: 0.5em; |
| 38 | line-height: 1em; | 37 | line-height: 1em; |
| 39 | color: lighten($text-dark, 32%); | 38 | color: lighten($text-dark, 32%); |
| 40 | } | 39 | } |
| 41 | } | 40 | } |
| 42 | 41 | ||
| 42 | +h5 { | ||
| 43 | + font-size: 1.4em; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +h5, h6 { | ||
| 47 | + font-weight: 500; | ||
| 48 | + line-height: 1.2em; | ||
| 49 | + margin-top: 0.78571429em; | ||
| 50 | + margin-bottom: 0.66em; | ||
| 51 | +} | ||
| 52 | + | ||
| 43 | /* | 53 | /* |
| 44 | * Link styling | 54 | * Link styling |
| 45 | */ | 55 | */ | ... | ... |
| 1 | <div class="book entity-list-item" data-entity-type="book" data-entity-id="{{$book->id}}"> | 1 | <div class="book entity-list-item" data-entity-type="book" data-entity-id="{{$book->id}}"> |
| 2 | - <h3 class="text-book"><a class="text-book entity-list-item-link" href="{{$book->getUrl()}}"><i class="zmdi zmdi-book"></i><span class="entity-list-item-name">{{$book->name}}</span></a></h3> | 2 | + <h4 class="text-book"><a class="text-book entity-list-item-link" href="{{$book->getUrl()}}"><i class="zmdi zmdi-book"></i><span class="entity-list-item-name">{{$book->name}}</span></a></h4> |
| 3 | @if(isset($book->searchSnippet)) | 3 | @if(isset($book->searchSnippet)) |
| 4 | <p class="text-muted">{!! $book->searchSnippet !!}</p> | 4 | <p class="text-muted">{!! $book->searchSnippet !!}</p> |
| 5 | @else | 5 | @else | ... | ... |
| 1 | <div class="chapter entity-list-item" data-entity-type="chapter" data-entity-id="{{$chapter->id}}"> | 1 | <div class="chapter entity-list-item" data-entity-type="chapter" data-entity-id="{{$chapter->id}}"> |
| 2 | - <h3> | 2 | + <h4> |
| 3 | @if (isset($showPath) && $showPath) | 3 | @if (isset($showPath) && $showPath) |
| 4 | <a href="{{ $chapter->book->getUrl() }}" class="text-book"> | 4 | <a href="{{ $chapter->book->getUrl() }}" class="text-book"> |
| 5 | <i class="zmdi zmdi-book"></i>{{ $chapter->book->name }} | 5 | <i class="zmdi zmdi-book"></i>{{ $chapter->book->name }} |
| ... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
| 9 | <a href="{{ $chapter->getUrl() }}" class="text-chapter entity-list-item-link"> | 9 | <a href="{{ $chapter->getUrl() }}" class="text-chapter entity-list-item-link"> |
| 10 | <i class="zmdi zmdi-collection-bookmark"></i><span class="entity-list-item-name">{{ $chapter->name }}</span> | 10 | <i class="zmdi zmdi-collection-bookmark"></i><span class="entity-list-item-name">{{ $chapter->name }}</span> |
| 11 | </a> | 11 | </a> |
| 12 | - </h3> | 12 | + </h4> |
| 13 | @if(isset($chapter->searchSnippet)) | 13 | @if(isset($chapter->searchSnippet)) |
| 14 | <p class="text-muted">{!! $chapter->searchSnippet !!}</p> | 14 | <p class="text-muted">{!! $chapter->searchSnippet !!}</p> |
| 15 | @else | 15 | @else |
| ... | @@ -20,7 +20,7 @@ | ... | @@ -20,7 +20,7 @@ |
| 20 | <p class="text-muted chapter-toggle"><i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ count($chapter->pages) }} Pages</span></p> | 20 | <p class="text-muted chapter-toggle"><i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ count($chapter->pages) }} Pages</span></p> |
| 21 | <div class="inset-list"> | 21 | <div class="inset-list"> |
| 22 | @foreach($chapter->pages as $page) | 22 | @foreach($chapter->pages as $page) |
| 23 | - <h4 class="@if($page->draft) draft @endif"><a href="{{ $page->getUrl() }}" class="text-page @if($page->draft) draft @endif"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4> | 23 | + <h5 class="@if($page->draft) draft @endif"><a href="{{ $page->getUrl() }}" class="text-page @if($page->draft) draft @endif"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h5> |
| 24 | @endforeach | 24 | @endforeach |
| 25 | </div> | 25 | </div> |
| 26 | @endif | 26 | @endif | ... | ... |
| ... | @@ -25,14 +25,14 @@ | ... | @@ -25,14 +25,14 @@ |
| 25 | <div class="col-sm-4"> | 25 | <div class="col-sm-4"> |
| 26 | <div id="recent-drafts"> | 26 | <div id="recent-drafts"> |
| 27 | @if(count($draftPages) > 0) | 27 | @if(count($draftPages) > 0) |
| 28 | - <h3>My Recent Drafts</h3> | 28 | + <h4>My Recent Drafts</h4> |
| 29 | @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact']) | 29 | @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact']) |
| 30 | @endif | 30 | @endif |
| 31 | </div> | 31 | </div> |
| 32 | @if($signedIn) | 32 | @if($signedIn) |
| 33 | - <h3>My Recently Viewed</h3> | 33 | + <h4>My Recently Viewed</h4> |
| 34 | @else | 34 | @else |
| 35 | - <h3>Recent Books</h3> | 35 | + <h4>Recent Books</h4> |
| 36 | @endif | 36 | @endif |
| 37 | @include('partials/entity-list', [ | 37 | @include('partials/entity-list', [ |
| 38 | 'entities' => $recents, | 38 | 'entities' => $recents, |
| ... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
| 42 | </div> | 42 | </div> |
| 43 | 43 | ||
| 44 | <div class="col-sm-4"> | 44 | <div class="col-sm-4"> |
| 45 | - <h3><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">Recently Created Pages</a></h3> | 45 | + <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">Recently Created Pages</a></h4> |
| 46 | <div id="recently-created-pages"> | 46 | <div id="recently-created-pages"> |
| 47 | @include('partials/entity-list', [ | 47 | @include('partials/entity-list', [ |
| 48 | 'entities' => $recentlyCreatedPages, | 48 | 'entities' => $recentlyCreatedPages, |
| ... | @@ -51,7 +51,7 @@ | ... | @@ -51,7 +51,7 @@ |
| 51 | ]) | 51 | ]) |
| 52 | </div> | 52 | </div> |
| 53 | 53 | ||
| 54 | - <h3><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">Recently Updated Pages</a></h3> | 54 | + <h4><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">Recently Updated Pages</a></h4> |
| 55 | <div id="recently-updated-pages"> | 55 | <div id="recently-updated-pages"> |
| 56 | @include('partials/entity-list', [ | 56 | @include('partials/entity-list', [ |
| 57 | 'entities' => $recentlyUpdatedPages, | 57 | 'entities' => $recentlyUpdatedPages, |
| ... | @@ -62,7 +62,7 @@ | ... | @@ -62,7 +62,7 @@ |
| 62 | </div> | 62 | </div> |
| 63 | 63 | ||
| 64 | <div class="col-sm-4" id="recent-activity"> | 64 | <div class="col-sm-4" id="recent-activity"> |
| 65 | - <h3>Recent Activity</h3> | 65 | + <h4>Recent Activity</h4> |
| 66 | @include('partials/activity-list', ['activity' => $activity]) | 66 | @include('partials/activity-list', ['activity' => $activity]) |
| 67 | </div> | 67 | </div> |
| 68 | 68 | ... | ... |
| 1 | <div class="page {{$page->draft ? 'draft' : ''}} entity-list-item" data-entity-type="page" data-entity-id="{{$page->id}}"> | 1 | <div class="page {{$page->draft ? 'draft' : ''}} entity-list-item" data-entity-type="page" data-entity-id="{{$page->id}}"> |
| 2 | - <h3> | 2 | + <h4> |
| 3 | <a href="{{ $page->getUrl() }}" class="text-page entity-list-item-link"><i class="zmdi zmdi-file-text"></i><span class="entity-list-item-name">{{ $page->name }}</span></a> | 3 | <a href="{{ $page->getUrl() }}" class="text-page entity-list-item-link"><i class="zmdi zmdi-file-text"></i><span class="entity-list-item-name">{{ $page->name }}</span></a> |
| 4 | - </h3> | 4 | + </h4> |
| 5 | 5 | ||
| 6 | @if(isset($page->searchSnippet)) | 6 | @if(isset($page->searchSnippet)) |
| 7 | <p class="text-muted">{!! $page->searchSnippet !!}</p> | 7 | <p class="text-muted">{!! $page->searchSnippet !!}</p> | ... | ... |
| ... | @@ -114,7 +114,8 @@ | ... | @@ -114,7 +114,8 @@ |
| 114 | @endif | 114 | @endif |
| 115 | </div> | 115 | </div> |
| 116 | @endif | 116 | @endif |
| 117 | - @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree]) | 117 | + |
| 118 | + @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree, 'pageNav' => $pageNav]) | ||
| 118 | </div> | 119 | </div> |
| 119 | 120 | ||
| 120 | </div> | 121 | </div> | ... | ... |
| 1 | 1 | ||
| 2 | <div class="book-tree" ng-non-bindable> | 2 | <div class="book-tree" ng-non-bindable> |
| 3 | + | ||
| 4 | + @if (isset($pageNav) && $pageNav) | ||
| 5 | + <h6 class="text-muted">Page Navigation</h6> | ||
| 6 | + <div class="sidebar-page-nav menu"> | ||
| 7 | + @foreach($pageNav as $navItem) | ||
| 8 | + <li class="page-nav-item {{ $navItem['nodeName'] }}"> | ||
| 9 | + <a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a> | ||
| 10 | + </li> | ||
| 11 | + @endforeach | ||
| 12 | + </div> | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + @endif | ||
| 16 | + | ||
| 3 | <h6 class="text-muted">Book Navigation</h6> | 17 | <h6 class="text-muted">Book Navigation</h6> |
| 4 | <ul class="sidebar-page-list menu"> | 18 | <ul class="sidebar-page-list menu"> |
| 5 | <li class="book-header"><a href="{{ $book->getUrl() }}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li> | 19 | <li class="book-header"><a href="{{ $book->getUrl() }}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li> | ... | ... |
-
Please register or sign in to post a comment