]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/show.blade.php
Updated attachment links to have dropdown for open type
[bookstack] / resources / views / chapters / show.blade.php
1 @extends('layouts.tri')
2
3 @section('container-attrs')
4     component="entity-search"
5     option:entity-search:entity-id="{{ $chapter->id }}"
6     option:entity-search:entity-type="chapter"
7 @stop
8
9 @push('social-meta')
10     <meta property="og:description" content="{{ Str::limit($chapter->description, 100, '...') }}">
11 @endpush
12
13 @section('body')
14
15     <div class="mb-m print-hidden">
16         @include('entities.breadcrumbs', ['crumbs' => [
17             $chapter->book,
18             $chapter,
19         ]])
20     </div>
21
22     <main class="content-wrap card">
23         <h1 class="break-text">{{ $chapter->name }}</h1>
24         <div refs="entity-search@contentView" class="chapter-content">
25             <p class="text-muted break-text">{!! nl2br(e($chapter->description)) !!}</p>
26             @if(count($pages) > 0)
27                 <div class="entity-list book-contents">
28                     @foreach($pages as $page)
29                         @include('pages.parts.list-item', ['page' => $page])
30                     @endforeach
31                 </div>
32             @else
33                 <div class="mt-xl">
34                     <hr>
35                     <p class="text-muted italic mb-m mt-xl">{{ trans('entities.chapters_empty') }}</p>
36
37                     <div class="icon-list block inline">
38                         @if(userCan('page-create', $chapter))
39                             <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item text-page">
40                                 <span class="icon">@icon('page')</span>
41                                 <span>{{ trans('entities.books_empty_create_page') }}</span>
42                             </a>
43                         @endif
44                         @if(userCan('book-update', $book))
45                             <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item text-book">
46                                 <span class="icon">@icon('book')</span>
47                                 <span>{{ trans('entities.books_empty_sort_current_book') }}</span>
48                             </a>
49                         @endif
50                     </div>
51
52                 </div>
53             @endif
54         </div>
55
56         @include('entities.search-results')
57     </main>
58
59     @include('entities.sibling-navigation', ['next' => $next, 'previous' => $previous])
60
61 @stop
62
63 @section('right')
64
65     <div class="mb-xl">
66         <h5>{{ trans('common.details') }}</h5>
67         <div class="blended-links">
68             @include('entities.meta', ['entity' => $chapter])
69
70             @if($book->restricted)
71                 <div class="active-restriction">
72                     @if(userCan('restrictions-manage', $book))
73                         <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
74                             @icon('lock')
75                             <div>{{ trans('entities.books_permissions_active') }}</div>
76                         </a>
77                     @else
78                         <div class="entity-meta-item">
79                             @icon('lock')
80                             <div>{{ trans('entities.books_permissions_active') }}</div>
81                         </div>
82                     @endif
83                 </div>
84             @endif
85
86             @if($chapter->restricted)
87                 <div class="active-restriction">
88                     @if(userCan('restrictions-manage', $chapter))
89                         <a href="{{ $chapter->getUrl('/permissions') }}" class="entity-meta-item">
90                             @icon('lock')
91                             <div>{{ trans('entities.chapters_permissions_active') }}</div>
92                         </a>
93                     @else
94                         <div class="entity-meta-item">
95                             @icon('lock')
96                             <div>{{ trans('entities.chapters_permissions_active') }}</div>
97                         </div>
98                     @endif
99                 </div>
100             @endif
101         </div>
102     </div>
103
104     <div class="actions mb-xl">
105         <h5>{{ trans('common.actions') }}</h5>
106         <div class="icon-list text-primary">
107
108             @if(userCan('page-create', $chapter))
109                 <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item">
110                     <span>@icon('add')</span>
111                     <span>{{ trans('entities.pages_new') }}</span>
112                 </a>
113             @endif
114
115             <hr class="primary-background"/>
116
117             @if(userCan('chapter-update', $chapter))
118                 <a href="{{ $chapter->getUrl('/edit') }}" class="icon-list-item">
119                     <span>@icon('edit')</span>
120                     <span>{{ trans('common.edit') }}</span>
121                 </a>
122             @endif
123             @if(userCanOnAny('chapter-create'))
124                 <a href="{{ $chapter->getUrl('/copy') }}" class="icon-list-item">
125                     <span>@icon('copy')</span>
126                     <span>{{ trans('common.copy') }}</span>
127                 </a>
128             @endif
129             @if(userCan('chapter-update', $chapter) && userCan('chapter-delete', $chapter))
130                 <a href="{{ $chapter->getUrl('/move') }}" class="icon-list-item">
131                     <span>@icon('folder')</span>
132                     <span>{{ trans('common.move') }}</span>
133                 </a>
134             @endif
135             @if(userCan('restrictions-manage', $chapter))
136                 <a href="{{ $chapter->getUrl('/permissions') }}" class="icon-list-item">
137                     <span>@icon('lock')</span>
138                     <span>{{ trans('entities.permissions') }}</span>
139                 </a>
140             @endif
141             @if(userCan('chapter-delete', $chapter))
142                 <a href="{{ $chapter->getUrl('/delete') }}" class="icon-list-item">
143                     <span>@icon('delete')</span>
144                     <span>{{ trans('common.delete') }}</span>
145                 </a>
146             @endif
147
148             <hr class="primary-background"/>
149
150             @if(signedInUser())
151                 @include('entities.favourite-action', ['entity' => $chapter])
152             @endif
153             @if(userCan('content-export'))
154                 @include('entities.export-menu', ['entity' => $chapter])
155             @endif
156         </div>
157     </div>
158 @stop
159
160 @section('left')
161
162     @include('entities.search-form', ['label' => trans('entities.chapters_search_this')])
163
164     @if($chapter->tags->count() > 0)
165         <div class="mb-xl">
166             @include('entities.tag-list', ['entity' => $chapter])
167         </div>
168     @endif
169
170     @include('entities.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
171 @stop
172
173