Showing
9 changed files
with
100 additions
and
9 deletions
| ... | @@ -451,6 +451,24 @@ class PageController extends Controller | ... | @@ -451,6 +451,24 @@ class PageController extends Controller |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | /** | 453 | /** |
| 454 | + * Show the view to choose a new parent to move a page into. | ||
| 455 | + * @param $bookSlug | ||
| 456 | + * @param $pageSlug | ||
| 457 | + * @return mixed | ||
| 458 | + * @throws NotFoundException | ||
| 459 | + */ | ||
| 460 | + public function showMove($bookSlug, $pageSlug) | ||
| 461 | + { | ||
| 462 | + $book = $this->bookRepo->getBySlug($bookSlug); | ||
| 463 | + $page = $this->pageRepo->getBySlug($pageSlug, $book->id); | ||
| 464 | + $this->checkOwnablePermission('page-update', $page); | ||
| 465 | + return view('pages/move', [ | ||
| 466 | + 'book' => $book, | ||
| 467 | + 'page' => $page | ||
| 468 | + ]); | ||
| 469 | + } | ||
| 470 | + | ||
| 471 | + /** | ||
| 454 | * Set the permissions for this page. | 472 | * Set the permissions for this page. |
| 455 | * @param $bookSlug | 473 | * @param $bookSlug |
| 456 | * @param $pageSlug | 474 | * @param $pageSlug | ... | ... |
| ... | @@ -34,6 +34,7 @@ Route::group(['middleware' => 'auth'], function () { | ... | @@ -34,6 +34,7 @@ Route::group(['middleware' => 'auth'], function () { |
| 34 | Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageController@exportHtml'); | 34 | Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageController@exportHtml'); |
| 35 | Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageController@exportPlainText'); | 35 | Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageController@exportPlainText'); |
| 36 | Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit'); | 36 | Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit'); |
| 37 | + Route::get('/{bookSlug}/page/{pageSlug}/move', 'PageController@showMove'); | ||
| 37 | Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete'); | 38 | Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete'); |
| 38 | Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft'); | 39 | Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft'); |
| 39 | Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showRestrict'); | 40 | Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showRestrict'); | ... | ... |
| ... | @@ -149,7 +149,10 @@ module.exports = function (ngApp, events) { | ... | @@ -149,7 +149,10 @@ module.exports = function (ngApp, events) { |
| 149 | }; | 149 | }; |
| 150 | }]); | 150 | }]); |
| 151 | 151 | ||
| 152 | - | 152 | + /** |
| 153 | + * Dropdown | ||
| 154 | + * Provides some simple logic to create small dropdown menus | ||
| 155 | + */ | ||
| 153 | ngApp.directive('dropdown', [function () { | 156 | ngApp.directive('dropdown', [function () { |
| 154 | return { | 157 | return { |
| 155 | restrict: 'A', | 158 | restrict: 'A', |
| ... | @@ -166,6 +169,10 @@ module.exports = function (ngApp, events) { | ... | @@ -166,6 +169,10 @@ module.exports = function (ngApp, events) { |
| 166 | }; | 169 | }; |
| 167 | }]); | 170 | }]); |
| 168 | 171 | ||
| 172 | + /** | ||
| 173 | + * TinyMCE | ||
| 174 | + * An angular wrapper around the tinyMCE editor. | ||
| 175 | + */ | ||
| 169 | ngApp.directive('tinymce', ['$timeout', function ($timeout) { | 176 | ngApp.directive('tinymce', ['$timeout', function ($timeout) { |
| 170 | return { | 177 | return { |
| 171 | restrict: 'A', | 178 | restrict: 'A', |
| ... | @@ -231,6 +238,10 @@ module.exports = function (ngApp, events) { | ... | @@ -231,6 +238,10 @@ module.exports = function (ngApp, events) { |
| 231 | } | 238 | } |
| 232 | }]); | 239 | }]); |
| 233 | 240 | ||
| 241 | + /** | ||
| 242 | + * Markdown input | ||
| 243 | + * Handles the logic for just the editor input field. | ||
| 244 | + */ | ||
| 234 | ngApp.directive('markdownInput', ['$timeout', function ($timeout) { | 245 | ngApp.directive('markdownInput', ['$timeout', function ($timeout) { |
| 235 | return { | 246 | return { |
| 236 | restrict: 'A', | 247 | restrict: 'A', |
| ... | @@ -263,6 +274,10 @@ module.exports = function (ngApp, events) { | ... | @@ -263,6 +274,10 @@ module.exports = function (ngApp, events) { |
| 263 | } | 274 | } |
| 264 | }]); | 275 | }]); |
| 265 | 276 | ||
| 277 | + /** | ||
| 278 | + * Markdown Editor | ||
| 279 | + * Handles all functionality of the markdown editor. | ||
| 280 | + */ | ||
| 266 | ngApp.directive('markdownEditor', ['$timeout', function ($timeout) { | 281 | ngApp.directive('markdownEditor', ['$timeout', function ($timeout) { |
| 267 | return { | 282 | return { |
| 268 | restrict: 'A', | 283 | restrict: 'A', |
| ... | @@ -342,6 +357,11 @@ module.exports = function (ngApp, events) { | ... | @@ -342,6 +357,11 @@ module.exports = function (ngApp, events) { |
| 342 | } | 357 | } |
| 343 | }]); | 358 | }]); |
| 344 | 359 | ||
| 360 | + /** | ||
| 361 | + * Page Editor Toolbox | ||
| 362 | + * Controls all functionality for the sliding toolbox | ||
| 363 | + * on the page edit view. | ||
| 364 | + */ | ||
| 345 | ngApp.directive('toolbox', [function () { | 365 | ngApp.directive('toolbox', [function () { |
| 346 | return { | 366 | return { |
| 347 | restrict: 'A', | 367 | restrict: 'A', |
| ... | @@ -378,6 +398,11 @@ module.exports = function (ngApp, events) { | ... | @@ -378,6 +398,11 @@ module.exports = function (ngApp, events) { |
| 378 | } | 398 | } |
| 379 | }]); | 399 | }]); |
| 380 | 400 | ||
| 401 | + /** | ||
| 402 | + * Tag Autosuggestions | ||
| 403 | + * Listens to child inputs and provides autosuggestions depending on field type | ||
| 404 | + * and input. Suggestions provided by server. | ||
| 405 | + */ | ||
| 381 | ngApp.directive('tagAutosuggestions', ['$http', function ($http) { | 406 | ngApp.directive('tagAutosuggestions', ['$http', function ($http) { |
| 382 | return { | 407 | return { |
| 383 | restrict: 'A', | 408 | restrict: 'A', |
| ... | @@ -557,6 +582,17 @@ module.exports = function (ngApp, events) { | ... | @@ -557,6 +582,17 @@ module.exports = function (ngApp, events) { |
| 557 | } | 582 | } |
| 558 | } | 583 | } |
| 559 | }]); | 584 | }]); |
| 585 | + | ||
| 586 | + | ||
| 587 | + ngApp.directive('entitySelector', ['$http', function ($http) { | ||
| 588 | + return { | ||
| 589 | + restrict: 'A', | ||
| 590 | + link: function (scope, element, attrs) { | ||
| 591 | + scope.loading = true; | ||
| 592 | + | ||
| 593 | + } | ||
| 594 | + }; | ||
| 595 | + }]); | ||
| 560 | }; | 596 | }; |
| 561 | 597 | ||
| 562 | 598 | ... | ... |
| ... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
| 3 | */ | 3 | */ |
| 4 | 4 | ||
| 5 | h1 { | 5 | h1 { |
| 6 | - font-size: 3.625em; | 6 | + font-size: 3.425em; |
| 7 | line-height: 1.22222222em; | 7 | line-height: 1.22222222em; |
| 8 | margin-top: 0.48888889em; | 8 | margin-top: 0.48888889em; |
| 9 | margin-bottom: 0.48888889em; | 9 | margin-bottom: 0.48888889em; |
| ... | @@ -33,10 +33,10 @@ h1, h2, h3, h4 { | ... | @@ -33,10 +33,10 @@ h1, h2, h3, h4 { |
| 33 | display: block; | 33 | display: block; |
| 34 | color: #555; | 34 | color: #555; |
| 35 | .subheader { | 35 | .subheader { |
| 36 | - display: block; | 36 | + //display: block; |
| 37 | font-size: 0.5em; | 37 | font-size: 0.5em; |
| 38 | line-height: 1em; | 38 | line-height: 1em; |
| 39 | - color: lighten($text-dark, 16%); | 39 | + color: lighten($text-dark, 32%); |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | 42 | ... | ... |
| 1 | -<div class="book"> | 1 | +<div class="book" data-entity-type="book" data-entity-id="{{$book->id}}"> |
| 2 | <h3 class="text-book"><a class="text-book" href="{{$book->getUrl()}}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></h3> | 2 | <h3 class="text-book"><a class="text-book" href="{{$book->getUrl()}}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></h3> |
| 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> | ... | ... |
| 1 | -<div class="chapter"> | 1 | +<div class="chapter" data-entity-type="chapter" data-entity-id="{{$chapter->id}}"> |
| 2 | <h3> | 2 | <h3> |
| 3 | <a href="{{ $chapter->getUrl() }}" class="text-chapter"> | 3 | <a href="{{ $chapter->getUrl() }}" class="text-chapter"> |
| 4 | <i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->name }} | 4 | <i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->name }} | ... | ... |
| 1 | -<div class="page {{$page->draft ? 'draft' : ''}}"> | 1 | +<div class="page {{$page->draft ? 'draft' : ''}}" data-entity-type="page" data-entity-id="{{$page->id}}"> |
| 2 | <h3> | 2 | <h3> |
| 3 | <a href="{{ $page->getUrl() }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ $page->name }}</a> | 3 | <a href="{{ $page->getUrl() }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ $page->name }}</a> |
| 4 | </h3> | 4 | </h3> |
| ... | @@ -11,11 +11,11 @@ | ... | @@ -11,11 +11,11 @@ |
| 11 | 11 | ||
| 12 | @if(isset($style) && $style === 'detailed') | 12 | @if(isset($style) && $style === 'detailed') |
| 13 | <div class="row meta text-muted text-small"> | 13 | <div class="row meta text-muted text-small"> |
| 14 | - <div class="col-md-4"> | 14 | + <div class="col-md-6"> |
| 15 | Created {{$page->created_at->diffForHumans()}} @if($page->createdBy)by {{$page->createdBy->name}}@endif <br> | 15 | Created {{$page->created_at->diffForHumans()}} @if($page->createdBy)by {{$page->createdBy->name}}@endif <br> |
| 16 | Last updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy)by {{$page->updatedBy->name}} @endif | 16 | Last updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy)by {{$page->updatedBy->name}} @endif |
| 17 | </div> | 17 | </div> |
| 18 | - <div class="col-md-8"> | 18 | + <div class="col-md-6"> |
| 19 | <a class="text-book" href="{{ $page->book->getUrl() }}"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName(30) }}</a> | 19 | <a class="text-book" href="{{ $page->book->getUrl() }}"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName(30) }}</a> |
| 20 | <br> | 20 | <br> |
| 21 | @if($page->chapter) | 21 | @if($page->chapter) | ... | ... |
resources/views/pages/move.blade.php
0 → 100644
| 1 | +@extends('base') | ||
| 2 | + | ||
| 3 | +@section('content') | ||
| 4 | + | ||
| 5 | + <div class="faded-small toolbar"> | ||
| 6 | + <div class="container"> | ||
| 7 | + <div class="row"> | ||
| 8 | + <div class="col-sm-12 faded"> | ||
| 9 | + <div class="breadcrumbs"> | ||
| 10 | + <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a> | ||
| 11 | + @if($page->hasChapter()) | ||
| 12 | + <span class="sep">»</span> | ||
| 13 | + <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button"> | ||
| 14 | + <i class="zmdi zmdi-collection-bookmark"></i> | ||
| 15 | + {{$page->chapter->getShortName()}} | ||
| 16 | + </a> | ||
| 17 | + @endif | ||
| 18 | + <span class="sep">»</span> | ||
| 19 | + <a href="{{$page->getUrl()}}" class="text-page text-button"><i class="zmdi zmdi-file-text"></i>{{ $page->getShortName() }}</a> | ||
| 20 | + </div> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="container"> | ||
| 27 | + <h1>Move Page <small class="subheader">{{$page->name}}</small></h1> | ||
| 28 | + | ||
| 29 | + <div class="bordered" ng-cloak entity-selector> | ||
| 30 | + <input type="text" placeholder="Search"> | ||
| 31 | + <div class="text-center" ng-if="loading">@include('partials/loading-icon')</div> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + | ||
| 35 | +@stop |
| ... | @@ -30,6 +30,7 @@ | ... | @@ -30,6 +30,7 @@ |
| 30 | @if(userCan('page-update', $page)) | 30 | @if(userCan('page-update', $page)) |
| 31 | <a href="{{$page->getUrl()}}/revisions" class="text-primary text-button"><i class="zmdi zmdi-replay"></i>Revisions</a> | 31 | <a href="{{$page->getUrl()}}/revisions" class="text-primary text-button"><i class="zmdi zmdi-replay"></i>Revisions</a> |
| 32 | <a href="{{$page->getUrl()}}/edit" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>Edit</a> | 32 | <a href="{{$page->getUrl()}}/edit" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>Edit</a> |
| 33 | + <a href="{{$page->getUrl()}}/move" class="text-primary text-button" ><i class="zmdi zmdi-folder"></i>Move</a> | ||
| 33 | @endif | 34 | @endif |
| 34 | @if(userCan('restrictions-manage', $page)) | 35 | @if(userCan('restrictions-manage', $page)) |
| 35 | <a href="{{$page->getUrl()}}/permissions" class="text-primary text-button"><i class="zmdi zmdi-lock-outline"></i>Permissions</a> | 36 | <a href="{{$page->getUrl()}}/permissions" class="text-primary text-button"><i class="zmdi zmdi-lock-outline"></i>Permissions</a> | ... | ... |
-
Please register or sign in to post a comment