]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/show.blade.php
6dd41b8905f295c59cddcab35cf9d68b1a872287
[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--}}
30                 <div v-pre class="well">
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 page">@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 book">@icon('book'){{ trans('entities.books_empty_sort_current_book') }}</a>
41                         @endif
42                     </p>
43                 </div>
44             @endif
45         </div>
46
47         <div class="search-results" v-cloak v-show="searching">
48             {{--TODO--}}
49             <h3 class="text-muted">{{ trans('entities.search_results') }} <a v-if="searching" @click="clearSearch()" class="text-small">@icon('close'){{ trans('entities.search_clear') }}</a></h3>
50             <div v-if="!searchResults">
51                 @include('partials/loading-icon')
52             </div>
53             <div v-html="searchResults"></div>
54         </div>
55     </div>
56
57 @stop
58
59 @section('right')
60
61     <div class="mb-xl">
62         <h5>{{ trans('common.details') }}</h5>
63         <div class="blended-links text-small text-muted">
64             @include('partials.entity-meta', ['entity' => $chapter])
65
66             @if($book->restricted)
67                 <div class="active-restriction">
68                     @if(userCan('restrictions-manage', $book))
69                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
70                     @else
71                         @icon('lock'){{ trans('entities.books_permissions_active') }}
72                     @endif
73                 </div>
74             @endif
75
76             @if($chapter->restricted)
77                 <div class="active-restriction">
78                     @if(userCan('restrictions-manage', $chapter))
79                         <a href="{{ $chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
80                     @else
81                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
82                     @endif
83                 </div>
84             @endif
85         </div>
86     </div>
87
88     <div class="actions mb-xl">
89         <h5>{{ trans('common.actions') }}</h5>
90         <div class="icon-list text-primary">
91
92             <div dropdown class="dropdown-container">
93                 <div dropdown-toggle class="icon-list-item">
94                     <span>@icon('export')</span>
95                     <span>{{ trans('entities.export') }}</span>
96                 </div>
97                 <ul class="wide">
98                     <li><a href="{{ $chapter->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
99                     <li><a href="{{ $chapter->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
100                     <li><a href="{{ $chapter->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
101                 </ul>
102             </div>
103
104             @if(userCan('page-create', $chapter))
105                 <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item">
106                     <span>@icon('add')</span>
107                     <span>{{ trans('entities.pages_new') }}</span>
108                 </a>
109             @endif
110             @if(userCan('chapter-update', $chapter))
111                 <a href="{{ $chapter->getUrl('/edit') }}" class="icon-list-item">
112                     <span>@icon('edit')</span>
113                     <span>{{ trans('common.edit') }}</span>
114                 </a>
115             @endif
116             @if(userCan('chapter-update', $chapter) && userCan('chapter-delete', $chapter))
117                 <a href="{{ $chapter->getUrl('/move') }}" class="icon-list-item">
118                     <span>@icon('folder')</span>
119                     <span>{{ trans('common.move') }}</span>
120                 </a>
121             @endif
122             @if(userCan('restrictions-manage', $chapter))
123                 <a href="{{ $chapter->getUrl('/permissions') }}" class="icon-list-item">
124                     <span>@icon('lock')</span>
125                     <span>{{ trans('entities.permissions') }}</span>
126                 </a>
127             @endif
128             @if(userCan('chapter-delete', $chapter))
129                 <a href="{{ $chapter->getUrl('/delete') }}" class="icon-list-item">
130                     <span>@icon('delete')</span>
131                     <span>{{ trans('common.delete') }}</span>
132                 </a>
133             @endif
134         </div>
135     </div>
136 @stop
137
138 @section('left')
139
140     @if($chapter->tags->count() > 0)
141         <div class="mb-xl">
142             @include('components.tag-list', ['entity' => $chapter])
143         </div>
144     @endif
145
146     <div class="mb-xl">
147         <form @submit.prevent="searchBook" class="search-box flexible">
148             <input v-model="searchTerm" @change="checkSearchForm()" type="text" name="term" placeholder="{{ trans('entities.chapters_search_this') }}">
149             <button type="submit">@icon('search')</button>
150             <button v-if="searching" v-cloak class="text-neg" @click="clearSearch()" type="button">@icon('close')</button>
151         </form>
152     </div>
153
154     @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
155 @stop
156
157