Updated page view styles to align with 2017 update

This commit is contained in:
Dan Brown 2017-08-26 15:41:33 +01:00
parent b60d2190ac
commit 36f524a354
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
20 changed files with 268 additions and 246 deletions

View File

@ -380,6 +380,7 @@ class PageController extends Controller
return view('pages/revision', [ return view('pages/revision', [
'page' => $page, 'page' => $page,
'book' => $page->book, 'book' => $page->book,
'revision' => $revision
]); ]);
} }
@ -409,6 +410,7 @@ class PageController extends Controller
'page' => $page, 'page' => $page,
'book' => $page->book, 'book' => $page->book,
'diff' => $diff, 'diff' => $diff,
'revision' => $revision
]); ]);
} }

View File

@ -47,4 +47,16 @@ class PageRevision extends Model
return null; 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';
}
} }

View File

@ -106,25 +106,25 @@ let setupPageShow = window.setupPageShow = function (pageId) {
goToText(event.target.getAttribute('href').substr(1)); 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 $window = $(window);
let $bookTree = $(".book-tree"); let $sidebar = $("#sidebar .scroll-body");
let $bookTreeParent = $bookTree.parent(); let $bookTreeParent = $sidebar.parent();
// Check the page is scrollable and the content is taller than the tree // 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 // Get current tree's width and header height
let headerHeight = $("#header").height() + $(".toolbar").height(); let headerHeight = $("#header").height() + $(".toolbar").height();
let isFixed = $window.scrollTop() > headerHeight; let isFixed = $window.scrollTop() > headerHeight;
// Function to fix the tree as a sidebar // Function to fix the tree as a sidebar
function stickTree() { function stickTree() {
$bookTree.width($bookTreeParent.width() + 15); $sidebar.width($bookTreeParent.width() + 15);
$bookTree.addClass("fixed"); $sidebar.addClass("fixed");
isFixed = true; isFixed = true;
} }
// Function to un-fix the tree back into position // Function to un-fix the tree back into position
function unstickTree() { function unstickTree() {
$bookTree.css('width', 'auto'); $sidebar.css('width', 'auto');
$bookTree.removeClass("fixed"); $sidebar.removeClass("fixed");
isFixed = false; isFixed = false;
} }
// Checks if the tree stickiness state should change // Checks if the tree stickiness state should change

View File

@ -204,4 +204,21 @@
background-color: #F8F8F8; background-color: #F8F8F8;
padding: $-m; padding: $-m;
border: 1px solid #DDD; 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 }
}
} }

View File

@ -86,25 +86,8 @@
// Sidebar list // Sidebar list
.book-tree { .book-tree {
position: relative;
right: 0;
top: 0;
transition: ease-in-out 240ms; transition: ease-in-out 240ms;
transition-property: right, border; 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 { .book-tree h4 {
padding: $-m $-s 0 $-s; padding: $-m $-s 0 $-s;

View File

@ -165,6 +165,7 @@ return [
'pages_move_success' => 'Page moved to ":parentName"', 'pages_move_success' => 'Page moved to ":parentName"',
'pages_permissions' => 'Page Permissions', 'pages_permissions' => 'Page Permissions',
'pages_permissions_success' => 'Page permissions updated', 'pages_permissions_success' => 'Page permissions updated',
'pages_revision' => 'Revision',
'pages_revisions' => 'Page Revisions', 'pages_revisions' => 'Page Revisions',
'pages_revisions_named' => 'Page Revisions for :pageName', 'pages_revisions_named' => 'Page Revisions for :pageName',
'pages_revision_named' => 'Page Revision for :pageName', 'pages_revision_named' => 'Page Revision for :pageName',

View File

@ -91,7 +91,7 @@
</div> </div>
</div> </div>
@include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree]) @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop @stop
@section('body') @section('body')

View File

@ -1,27 +1,30 @@
@extends('base') @extends('simple-layout')
@section('content') @section('toolbar')
<div class="col-sm-12 faded">
@include('pages._breadcrumbs', ['page' => $page])
</div>
@stop
<div class="faded-small toolbar"> @section('body')
<div class="container">
<div class="row"> <div class="container small" ng-non-bindable>
<div class="col-sm-12 faded"> <p>&nbsp;</p>
@include('pages._breadcrumbs', ['page' => $page]) <div class="card">
</div> <h3><i class="zmdi zmdi-delete"></i> {{ $page->draft ? trans('entities.pages_delete_draft') : trans('entities.pages_delete') }}</h3>
<div class="body">
<p class="text-neg">{{ $page->draft ? trans('entities.pages_delete_draft_confirm'): trans('entities.pages_delete_confirm') }}</p>
<form action="{{ $page->getUrl() }}" method="POST">
{!! csrf_field() !!}
<input type="hidden" name="_method" value="DELETE">
<div class="form-group">
<a href="{{ $page->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
<button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
<div class="container small" ng-non-bindable>
<h1>{{ $page->draft ? trans('entities.pages_delete_draft') : trans('entities.pages_delete') }}</h1>
<p class="text-neg">{{ $page->draft ? trans('entities.pages_delete_draft_confirm'): trans('entities.pages_delete_confirm') }}</p>
<form action="{{ $page->getUrl() }}" method="POST">
{!! csrf_field() !!}
<input type="hidden" name="_method" value="DELETE">
<a href="{{ $page->getUrl() }}" class="button primary">{{ trans('common.cancel') }}</a>
<button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
</form>
</div>
@stop @stop

View File

@ -1,18 +1,15 @@
@extends('base') @extends('simple-layout')
@section('content') @section('body')
<div class="container small">
<div class="container"> <p>&nbsp;</p>
<div class="row"> <div class="card">
<h3>{{ $title }}</h3>
<div class="col-sm-7"> @include('partials/entity-list', ['entities' => $pages, 'style' => 'detailed'])
<h1>{{ $title }}</h1> <div class="body text-center">
@include('partials/entity-list', ['entities' => $pages, 'style' => 'detailed'])
{!! $pages->links() !!} {!! $pages->links() !!}
</div> </div>
<div class="col-sm-4 col-sm-offset-1"></div>
</div> </div>
</div> </div>
@stop @stop

View File

@ -16,8 +16,6 @@
@include('pages/form', ['model' => $page]) @include('pages/form', ['model' => $page])
@include('pages/form-toolbox') @include('pages/form-toolbox')
</form> </form>
</div> </div>
@include('components.image-manager', ['imageType' => 'gallery', 'uploaded_to' => $page->id]) @include('components.image-manager', ['imageType' => 'gallery', 'uploaded_to' => $page->id])

View File

@ -5,7 +5,7 @@
{{--Header Bar--}} {{--Header Bar--}}
<div class="faded-small toolbar"> <div class="faded-small toolbar">
<div class="container"> <div class="container fluid">
<div class="row"> <div class="row">
<div class="col-sm-4 faded"> <div class="col-sm-4 faded">
<div class="action-buttons text-left"> <div class="action-buttons text-left">

View File

@ -1,29 +1,31 @@
@extends('base') @extends('simple-layout')
@section('content') @section('toolbar')
<div class="col-sm-12 faded">
@include('pages._breadcrumbs', ['page' => $page])
</div>
@stop
<div class="faded-small toolbar"> @section('body')
<div class="container">
<div class="row"> <div class="container">
<div class="col-sm-12 faded"> <p>&nbsp;</p>
@include('pages._breadcrumbs', ['page' => $page]) <div class="card">
</div> <h3><i class="zmdi zmdi-folder"></i> {{ trans('entities.pages_move') }}</h3>
<div class="body">
<form action="{{ $page->getUrl('/move') }}" method="POST">
{!! csrf_field() !!}
<input type="hidden" name="_method" value="PUT">
@include('components.entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book,chapter'])
<div class="form-group text-right">
<a href="{{ $page->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
<button type="submit" class="button pos">{{ trans('entities.pages_move') }}</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
<div class="container">
<h1>{{ trans('entities.pages_move') }}</h1>
<form action="{{ $page->getUrl('/move') }}" method="POST">
{!! csrf_field() !!}
<input type="hidden" name="_method" value="PUT">
@include('components.entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book,chapter'])
<a href="{{ $page->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
<button type="submit" class="button pos">{{ trans('entities.pages_move') }}</button>
</form>
</div>
@stop @stop

View File

@ -1,20 +1,19 @@
@extends('base') @extends('simple-layout')
@section('content') @section('toolbar')
<div class="col-sm-12 faded">
@include('pages._breadcrumbs', ['page' => $page])
</div>
@stop
<div class="faded-small toolbar"> @section('body')
<div class="container"> <div class="container" ng-non-bindable>
<div class="row"> <p>&nbsp;</p>
<div class="col-sm-12 faded"> <div class="card">
@include('pages._breadcrumbs', ['page' => $page]) <h3><i class="zmdi zmdi-lock-outline"></i> {{ trans('entities.pages_permissions') }}</h3>
</div> <div class="body">
@include('form.restriction-form', ['model' => $page])
</div> </div>
</div> </div>
</div> </div>
<div class="container" ng-non-bindable>
<h1>{{ trans('entities.pages_permissions') }}</h1>
@include('form.restriction-form', ['model' => $page])
</div>
@stop @stop

View File

@ -1,12 +1,20 @@
@extends('base') @extends('sidebar-layout')
@section('content') @section('sidebar')
<div class="card">
<h3><i class="zmdi zmdi-info-outline"></i> {{ trans('common.details') }}</h3>
<div class="body">
@include('partials.entity-meta', ['entity' => $revision])
</div>
</div>
@stop
@section('body')
<div class="container" ng-non-bindable> <div class="container" ng-non-bindable>
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
<div class="page-content anim fadeIn"> <div class="page-content">
@include('pages.page-display') @include('pages.page-display')
</div> </div>
</div> </div>

View File

@ -1,62 +1,62 @@
@extends('base') @extends('simple-layout')
@section('content') @section('toolbar')
<div class="col-sm-12 faded">
@include('pages._breadcrumbs', ['page' => $page])
</div>
@stop
<div class="faded-small toolbar"> @section('body')
<div class="container"> <div class="container" ng-non-bindable>
<div class="row"> <p>&nbsp;</p>
<div class="col-sm-12 faded">
@include('pages._breadcrumbs', ['page' => $page]) <div class="card">
</div> <h3><i class="zmdi zmdi-replay"></i> {{ trans('entities.pages_revisions') }}</h3>
<div class="body">
@if(count($page->revisions) > 0)
<table class="table">
<tr>
<th width="3%">{{ trans('entities.pages_revisions_number') }}</th>
<th width="23%">{{ trans('entities.pages_name') }}</th>
<th colspan="2" width="8%">{{ trans('entities.pages_revisions_created_by') }}</th>
<th width="15%">{{ trans('entities.pages_revisions_date') }}</th>
<th width="25%">{{ trans('entities.pages_revisions_changelog') }}</th>
<th width="20%">{{ trans('common.actions') }}</th>
</tr>
@foreach($page->revisions as $index => $revision)
<tr>
<td>{{ $revision->revision_number == 0 ? '' : $revision->revision_number }}</td>
<td>{{ $revision->name }}</td>
<td style="line-height: 0;">
@if($revision->createdBy)
<img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{ $revision->createdBy->name }}">
@endif
</td>
<td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td>
<td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
<td>{{ $revision->summary }}</td>
<td>
<a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a>
<span class="text-muted">&nbsp;|&nbsp;</span>
@if ($index === 0)
<a target="_blank" href="{{ $page->getUrl() }}"><i>{{ trans('entities.pages_revisions_current') }}</i></a>
@else
<a href="{{ $revision->getUrl() }}" target="_blank">{{ trans('entities.pages_revisions_preview') }}</a>
<span class="text-muted">&nbsp;|&nbsp;</span>
<a href="{{ $revision->getUrl('restore') }}">{{ trans('entities.pages_revisions_restore') }}</a>
@endif
</td>
</tr>
@endforeach
</table>
@else
<p>{{ trans('entities.pages_revisions_none') }}</p>
@endif
</div> </div>
</div> </div>
</div>
<div class="container" ng-non-bindable>
<h1>{{ trans('entities.pages_revisions') }}</h1>
@if(count($page->revisions) > 0)
<table class="table">
<tr>
<th width="3%">{{ trans('entities.pages_revisions_number') }}</th>
<th width="23%">{{ trans('entities.pages_name') }}</th>
<th colspan="2" width="8%">{{ trans('entities.pages_revisions_created_by') }}</th>
<th width="15%">{{ trans('entities.pages_revisions_date') }}</th>
<th width="25%">{{ trans('entities.pages_revisions_changelog') }}</th>
<th width="20%">{{ trans('common.actions') }}</th>
</tr>
@foreach($page->revisions as $index => $revision)
<tr>
<td>{{ $revision->revision_number == 0 ? '' : $revision->revision_number }}</td>
<td>{{ $revision->name }}</td>
<td style="line-height: 0;">
@if($revision->createdBy)
<img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{ $revision->createdBy->name }}">
@endif
</td>
<td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td>
<td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
<td>{{ $revision->summary }}</td>
<td>
<a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a>
<span class="text-muted">&nbsp;|&nbsp;</span>
@if ($index === 0)
<a target="_blank" href="{{ $page->getUrl() }}"><i>{{ trans('entities.pages_revisions_current') }}</i></a>
@else
<a href="{{ $revision->getUrl() }}" target="_blank">{{ trans('entities.pages_revisions_preview') }}</a>
<span class="text-muted">&nbsp;|&nbsp;</span>
<a href="{{ $revision->getUrl('restore') }}">{{ trans('entities.pages_revisions_restore') }}</a>
@endif
</td>
</tr>
@endforeach
</table>
@else
<p>{{ trans('entities.pages_revisions_none') }}</p>
@endif
</div> </div>

View File

@ -19,7 +19,7 @@
@endif @endif
@if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page)) @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
<div dropdown class="dropdown-container"> <div dropdown class="dropdown-container">
<a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i> {{ trans('common.more') }}</a>
<ul> <ul>
@if(userCan('page-update', $page)) @if(userCan('page-update', $page))
<li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li> <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
@ -77,7 +77,53 @@
</div> </div>
@endif @endif
@include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree, 'pageNav' => $pageNav]) @if($page->tags->count() > 0)
<div class="card tag-display">
<h3><i class="zmdi zmdi-tag"></i> {{ trans('entities.page_tags') }}</h3>
<div class="body">
<table>
<tbody>
@foreach($page->tags as $tag)
<tr class="tag">
<td @if(!$tag->value) colspan="2" @endif><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a></td>
@if($tag->value) <td class="tag-value"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></td> @endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@if ($page->attachments->count() > 0)
<div class="card">
<h3><i class="zmdi zmdi-attachment-alt"></i> {{ trans('entities.pages_attachments') }}</h3>
<div class="body">
@foreach($page->attachments as $attachment)
<div class="attachment">
<a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif><i class="zmdi zmdi-{{ $attachment->external ? 'open-in-new' : 'file' }}"></i>{{ $attachment->name }}</a>
</div>
@endforeach
</div>
</div>
@endif
@if (isset($pageNav) && count($pageNav))
<div class="card">
<h3><i class="zmdi zmdi-compass"></i> {{ trans('entities.pages_navigation') }}</h3>
<div class="body">
<div class="sidebar-page-nav menu">
@foreach($pageNav as $navItem)
<li class="page-nav-item h{{ $navItem['level'] }}">
<a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
</li>
@endforeach
</div>
</div>
</div>
@endif
@include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
<div class="card"> <div class="card">
<h3><i class="zmdi zmdi-info-outline"></i> {{ trans('common.details') }}</h3> <h3><i class="zmdi zmdi-info-outline"></i> {{ trans('common.details') }}</h3>

View File

@ -1,87 +0,0 @@
<div class="book-tree" ng-non-bindable>
@if(isset($page) && $page->tags->count() > 0)
<div class="card tag-display">
<h3><i class="zmdi zmdi-tag"></i> {{ trans('entities.page_tags') }}</h3>
<div class="body">
<table>
<tbody>
@foreach($page->tags as $tag)
<tr class="tag">
<td @if(!$tag->value) colspan="2" @endif><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a></td>
@if($tag->value) <td class="tag-value"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></td> @endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@if (isset($page) && $page->attachments->count() > 0)
<div class="card">
<h3><i class="zmdi zmdi-attachment-alt"></i> {{ trans('entities.pages_attachments') }}</h3>
<div class="body">
@foreach($page->attachments as $attachment)
<div class="attachment">
<a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif><i class="zmdi zmdi-{{ $attachment->external ? 'open-in-new' : 'file' }}"></i>{{ $attachment->name }}</a>
</div>
@endforeach
</div>
</div>
@endif
@if (isset($pageNav) && count($pageNav))
<div class="card">
<h3><i class="zmdi zmdi-compass"></i> {{ trans('entities.pages_navigation') }}</h3>
<div class="body">
<div class="sidebar-page-nav menu">
@foreach($pageNav as $navItem)
<li class="page-nav-item h{{ $navItem['level'] }}">
<a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
</li>
@endforeach
</div>
</div>
</div>
@endif
<div class="card">
<h3><i class="zmdi zmdi-book"></i> {{ trans('entities.books_navigation') }}</h3>
<div class="body">
<ul class="sidebar-page-list menu">
@if (userCan('view', $book))
<li class="book-header"><a href="{{ $book->getUrl() }}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li>
@endif
@foreach($sidebarTree as $bookChild)
<li class="list-item-{{ $bookChild->getClassName() }} {{ $bookChild->getClassName() }} {{ $bookChild->isA('page') && $bookChild->draft ? 'draft' : '' }}">
<a href="{{ $bookChild->getUrl() }}" class="{{ $bookChild->getClassName() }} {{ $current->matches($bookChild)? 'selected' : '' }}">
@if($bookChild->isA('chapter'))<i class="zmdi zmdi-collection-bookmark"></i>@else <i class="zmdi zmdi-file-text"></i>@endif{{ $bookChild->name }}
</a>
@if($bookChild->isA('chapter') && count($bookChild->pages) > 0)
<p chapter-toggle class="text-muted @if($bookChild->matchesOrContains($current)) open @endif">
<i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ trans('entities.x_pages', ['count' => $bookChild->pages->count()]) }}</span>
</p>
<ul class="menu sub-menu inset-list @if($bookChild->matchesOrContains($current)) open @endif">
@foreach($bookChild->pages as $childPage)
<li class="list-item-page {{ $childPage->isA('page') && $childPage->draft ? 'draft' : '' }}">
<a href="{{ $childPage->getUrl() }}" class="page {{ $current->matches($childPage)? 'selected' : '' }}">
<i class="zmdi zmdi-file-text"></i> {{ $childPage->name }}
</a>
</li>
@endforeach
</ul>
@endif
</li>
@endforeach
</ul>
</div>
</div>
</div>

View File

@ -0,0 +1,36 @@
<div class="card book-tree" ng-non-bindable>
<h3><i class="zmdi zmdi-book"></i> {{ trans('entities.books_navigation') }}</h3>
<div class="body">
<ul class="sidebar-page-list menu">
@if (userCan('view', $book))
<li class="book-header"><a href="{{ $book->getUrl() }}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li>
@endif
@foreach($sidebarTree as $bookChild)
<li class="list-item-{{ $bookChild->getClassName() }} {{ $bookChild->getClassName() }} {{ $bookChild->isA('page') && $bookChild->draft ? 'draft' : '' }}">
<a href="{{ $bookChild->getUrl() }}" class="{{ $bookChild->getClassName() }} {{ $current->matches($bookChild)? 'selected' : '' }}">
@if($bookChild->isA('chapter'))<i class="zmdi zmdi-collection-bookmark"></i>@else <i class="zmdi zmdi-file-text"></i>@endif{{ $bookChild->name }}
</a>
@if($bookChild->isA('chapter') && count($bookChild->pages) > 0)
<p chapter-toggle class="text-muted @if($bookChild->matchesOrContains($current)) open @endif">
<i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ trans('entities.x_pages', ['count' => $bookChild->pages->count()]) }}</span>
</p>
<ul class="menu sub-menu inset-list @if($bookChild->matchesOrContains($current)) open @endif">
@foreach($bookChild->pages as $childPage)
<li class="list-item-page {{ $childPage->isA('page') && $childPage->draft ? 'draft' : '' }}">
<a href="{{ $childPage->getUrl() }}" class="page {{ $current->matches($childPage)? 'selected' : '' }}">
<i class="zmdi zmdi-file-text"></i> {{ $childPage->name }}
</a>
</li>
@endforeach
</ul>
@endif
</li>
@endforeach
</ul>
</div>
</div>

View File

@ -1,4 +1,9 @@
<p class="text-muted small"> <p class="text-muted small">
@if($entity->isA('revision'))
{{ trans('entities.pages_revision') }}
{{ trans('entities.pages_revisions_number') }}{{ $entity->revision_number == 0 ? '' : $entity->revision_number }}
<br>
@endif
@if ($entity->isA('page')) {{ trans('entities.meta_revision', ['revisionCount' => $entity->revision_count]) }} <br> @endif @if ($entity->isA('page')) {{ trans('entities.meta_revision', ['revisionCount' => $entity->revision_count]) }} <br> @endif
@if ($entity->createdBy) @if ($entity->createdBy)
{!! trans('entities.meta_created_name', [ {!! trans('entities.meta_created_name', [
@ -14,7 +19,7 @@
'timeLength' => '<span title="' . $entity->updated_at->toDayDateTimeString() .'">' . $entity->updated_at->diffForHumans() .'</span>', 'timeLength' => '<span title="' . $entity->updated_at->toDayDateTimeString() .'">' . $entity->updated_at->diffForHumans() .'</span>',
'user' => "<a href='{$entity->updatedBy->getProfileUrl()}'>".htmlentities($entity->updatedBy->name). "</a>" 'user' => "<a href='{$entity->updatedBy->getProfileUrl()}'>".htmlentities($entity->updatedBy->name). "</a>"
]) !!} ]) !!}
@else @elseif (!$entity->isA('revision'))
<span title="{{ $entity->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $entity->updated_at->diffForHumans()]) }}</span> <span title="{{ $entity->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $entity->updated_at->diffForHumans()]) }}</span>
@endif @endif
</p> </p>

View File

@ -15,7 +15,7 @@
<div class="flex-fill flex" @yield('container-attrs') > <div class="flex-fill flex" @yield('container-attrs') >
<div class="sidebar flex print-hidden"> <div class="sidebar flex print-hidden" id="sidebar">
<div class="scroll-body"> <div class="scroll-body">
@yield('sidebar') @yield('sidebar')
</div> </div>