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