diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 9a8525c23..573907e56 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -380,6 +380,7 @@ class PageController extends Controller return view('pages/revision', [ 'page' => $page, 'book' => $page->book, + 'revision' => $revision ]); } @@ -409,6 +410,7 @@ class PageController extends Controller 'page' => $page, 'book' => $page->book, 'diff' => $diff, + 'revision' => $revision ]); } diff --git a/app/PageRevision.php b/app/PageRevision.php index ff469f0ed..0a9764729 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -47,4 +47,16 @@ class PageRevision extends Model return null; } + /** + * Allows checking of the exact class, Used to check entity type. + * Included here to align with entities in similar use cases. + * (Yup, Bit of an awkward hack) + * @param $type + * @return bool + */ + public static function isA($type) + { + return $type === 'revision'; + } + } diff --git a/resources/assets/js/pages/page-show.js b/resources/assets/js/pages/page-show.js index 7754840af..832ec4b36 100644 --- a/resources/assets/js/pages/page-show.js +++ b/resources/assets/js/pages/page-show.js @@ -106,25 +106,25 @@ let setupPageShow = window.setupPageShow = function (pageId) { goToText(event.target.getAttribute('href').substr(1)); }); - // Make the book-tree sidebar stick in view on scroll + // Make the sidebar stick in view on scroll let $window = $(window); - let $bookTree = $(".book-tree"); - let $bookTreeParent = $bookTree.parent(); + let $sidebar = $("#sidebar .scroll-body"); + let $bookTreeParent = $sidebar.parent(); // Check the page is scrollable and the content is taller than the tree - let pageScrollable = ($(document).height() > $window.height()) && ($bookTree.height() < $('.page-content').height()); + let pageScrollable = ($(document).height() > $window.height()) && ($sidebar.height() < $('.page-content').height()); // Get current tree's width and header height let headerHeight = $("#header").height() + $(".toolbar").height(); let isFixed = $window.scrollTop() > headerHeight; // Function to fix the tree as a sidebar function stickTree() { - $bookTree.width($bookTreeParent.width() + 15); - $bookTree.addClass("fixed"); + $sidebar.width($bookTreeParent.width() + 15); + $sidebar.addClass("fixed"); isFixed = true; } // Function to un-fix the tree back into position function unstickTree() { - $bookTree.css('width', 'auto'); - $bookTree.removeClass("fixed"); + $sidebar.css('width', 'auto'); + $sidebar.removeClass("fixed"); isFixed = false; } // Checks if the tree stickiness state should change diff --git a/resources/assets/sass/_blocks.scss b/resources/assets/sass/_blocks.scss index c5b850507..c804b9aa8 100644 --- a/resources/assets/sass/_blocks.scss +++ b/resources/assets/sass/_blocks.scss @@ -204,4 +204,21 @@ background-color: #F8F8F8; padding: $-m; border: 1px solid #DDD; +} + +#sidebar .scroll-body { + &.fixed { + z-index: 5; + position: fixed; + top: 0; + padding-right: $-m; + width: 30%; + left: 0; + height: 100%; + overflow-y: scroll; + -ms-overflow-style: none; + //background-color: $primary-faded; + border-left: 1px solid #DDD; + &::-webkit-scrollbar { width: 0 !important } + } } \ No newline at end of file diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index 5d607ba16..2dd4732f2 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -86,25 +86,8 @@ // Sidebar list .book-tree { - position: relative; - right: 0; - top: 0; transition: ease-in-out 240ms; transition-property: right, border; - &.fixed { - z-index: 5; - position: fixed; - top: 0; - padding-right: $-l + 5px; - width: 30%; - left: 0; - height: 100%; - overflow-y: scroll; - -ms-overflow-style: none; - //background-color: $primary-faded; - border-left: 1px solid #DDD; - &::-webkit-scrollbar { width: 0 !important } - } } .book-tree h4 { padding: $-m $-s 0 $-s; diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php index 76555fee4..b8be379cd 100644 --- a/resources/lang/en/entities.php +++ b/resources/lang/en/entities.php @@ -165,6 +165,7 @@ return [ 'pages_move_success' => 'Page moved to ":parentName"', 'pages_permissions' => 'Page Permissions', 'pages_permissions_success' => 'Page permissions updated', + 'pages_revision' => 'Revision', 'pages_revisions' => 'Page Revisions', 'pages_revisions_named' => 'Page Revisions for :pageName', 'pages_revision_named' => 'Page Revision for :pageName', diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php index ac2dbfffd..e5a044aa7 100644 --- a/resources/views/chapters/show.blade.php +++ b/resources/views/chapters/show.blade.php @@ -91,7 +91,7 @@ - @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree]) + @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree]) @stop @section('body') diff --git a/resources/views/pages/delete.blade.php b/resources/views/pages/delete.blade.php index f94a614fb..47906a1f6 100644 --- a/resources/views/pages/delete.blade.php +++ b/resources/views/pages/delete.blade.php @@ -1,27 +1,30 @@ -@extends('base') +@extends('simple-layout') -@section('content') +@section('toolbar') +