]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/show.blade.php
Updated and aligned entity dashboard elements
[bookstack] / resources / views / chapters / show.blade.php
1 @extends('tri-layout')
2
3 @section('container-attrs')
4     id="entity-dashboard"
5     entity-id="{{ $chapter->id }}"
6     entity-type="chapter"
7 @stop
8
9 @section('body')
10
11     <div class="mb-m">
12         @include('partials.breadcrumbs', ['crumbs' => [
13             $chapter->book,
14             $chapter,
15         ]])
16     </div>
17
18     <div class="content-wrap card">
19         <h1 class="break-text" v-pre>{{ $chapter->name }}</h1>
20         <div class="chapter-content" v-show="!searching">
21             <p v-pre class="text-muted break-text">{!! nl2br(e($chapter->description)) !!}</p>
22             @if(count($pages) > 0)
23                 <div v-pre class="entity-list book-contents">
24                     @foreach($pages as $page)
25                         @include('pages.list-item', ['page' => $page])
26                     @endforeach
27                 </div>
28             @else
29                 {{--TODO - Empty States --}}
30                 <div v-pre>
31                     <p class="text-muted italic">{{ trans('entities.chapters_empty') }}</p>
32                     <p>
33                         @if(userCan('page-create', $chapter))
34                             <a href="{{ $chapter->getUrl('/create-page') }}" class="button outline">@icon('page'){{ trans('entities.books_empty_create_page') }}</a>
35                         @endif
36                         @if(userCan('page-create', $chapter) && userCan('book-update', $book))
37                             &nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp; &nbsp;
38                         @endif
39                         @if(userCan('book-update', $book))
40                             <a href="{{ $book->getUrl('/sort') }}" class="button outline">@icon('book'){{ trans('entities.books_empty_sort_current_book') }}</a>
41                         @endif
42                     </p>
43                 </div>
44             @endif
45         </div>
46
47         @include('partials.entity-dashboard-search-results')
48     </div>
49
50 @stop
51
52 @section('right')
53
54     <div class="mb-xl">
55         <h5>{{ trans('common.details') }}</h5>
56         <div class="blended-links text-small text-muted">
57             @include('partials.entity-meta', ['entity' => $chapter])
58
59             @if($book->restricted)
60                 <div class="active-restriction">
61                     @if(userCan('restrictions-manage', $book))
62                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
63                     @else
64                         @icon('lock'){{ trans('entities.books_permissions_active') }}
65                     @endif
66                 </div>
67             @endif
68
69             @if($chapter->restricted)
70                 <div class="active-restriction">
71                     @if(userCan('restrictions-manage', $chapter))
72                         <a href="{{ $chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
73                     @else
74                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
75                     @endif
76                 </div>
77             @endif
78         </div>
79     </div>
80
81     <div class="actions mb-xl">
82         <h5>{{ trans('common.actions') }}</h5>
83         <div class="icon-list text-primary">
84
85             <div dropdown class="dropdown-container">
86                 <div dropdown-toggle class="icon-list-item">
87                     <span>@icon('export')</span>
88                     <span>{{ trans('entities.export') }}</span>
89                 </div>
90                 <ul class="wide">
91                     <li><a href="{{ $chapter->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
92                     <li><a href="{{ $chapter->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
93                     <li><a href="{{ $chapter->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
94                 </ul>
95             </div>
96
97             @if(userCan('page-create', $chapter))
98                 <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item">
99                     <span>@icon('add')</span>
100                     <span>{{ trans('entities.pages_new') }}</span>
101                 </a>
102             @endif
103             @if(userCan('chapter-update', $chapter))
104                 <a href="{{ $chapter->getUrl('/edit') }}" class="icon-list-item">
105                     <span>@icon('edit')</span>
106                     <span>{{ trans('common.edit') }}</span>
107                 </a>
108             @endif
109             @if(userCan('chapter-update', $chapter) && userCan('chapter-delete', $chapter))
110                 <a href="{{ $chapter->getUrl('/move') }}" class="icon-list-item">
111                     <span>@icon('folder')</span>
112                     <span>{{ trans('common.move') }}</span>
113                 </a>
114             @endif
115             @if(userCan('restrictions-manage', $chapter))
116                 <a href="{{ $chapter->getUrl('/permissions') }}" class="icon-list-item">
117                     <span>@icon('lock')</span>
118                     <span>{{ trans('entities.permissions') }}</span>
119                 </a>
120             @endif
121             @if(userCan('chapter-delete', $chapter))
122                 <a href="{{ $chapter->getUrl('/delete') }}" class="icon-list-item">
123                     <span>@icon('delete')</span>
124                     <span>{{ trans('common.delete') }}</span>
125                 </a>
126             @endif
127         </div>
128     </div>
129 @stop
130
131 @section('left')
132
133     @include('partials.entity-dashboard-search-box')
134
135     @if($chapter->tags->count() > 0)
136         <div class="mb-xl">
137             @include('components.tag-list', ['entity' => $chapter])
138         </div>
139     @endif
140
141     @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
142 @stop
143
144