]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/show.blade.php
Fixed failing test after drawio default url change
[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 text-small text-muted">
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') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
74                     @else
75                         @icon('lock'){{ trans('entities.books_permissions_active') }}
76                     @endif
77                 </div>
78             @endif
79
80             @if($chapter->restricted)
81                 <div class="active-restriction">
82                     @if(userCan('restrictions-manage', $chapter))
83                         <a href="{{ $chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
84                     @else
85                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
86                     @endif
87                 </div>
88             @endif
89         </div>
90     </div>
91
92     <div class="actions mb-xl">
93         <h5>{{ trans('common.actions') }}</h5>
94         <div class="icon-list text-primary">
95
96             @if(userCan('page-create', $chapter))
97                 <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item">
98                     <span>@icon('add')</span>
99                     <span>{{ trans('entities.pages_new') }}</span>
100                 </a>
101             @endif
102
103             <hr class="primary-background"/>
104
105             @if(userCan('chapter-update', $chapter))
106                 <a href="{{ $chapter->getUrl('/edit') }}" class="icon-list-item">
107                     <span>@icon('edit')</span>
108                     <span>{{ trans('common.edit') }}</span>
109                 </a>
110             @endif
111             @if(userCanOnAny('chapter-create'))
112                 <a href="{{ $chapter->getUrl('/copy') }}" class="icon-list-item">
113                     <span>@icon('copy')</span>
114                     <span>{{ trans('common.copy') }}</span>
115                 </a>
116             @endif
117             @if(userCan('chapter-update', $chapter) && userCan('chapter-delete', $chapter))
118                 <a href="{{ $chapter->getUrl('/move') }}" class="icon-list-item">
119                     <span>@icon('folder')</span>
120                     <span>{{ trans('common.move') }}</span>
121                 </a>
122             @endif
123             @if(userCan('restrictions-manage', $chapter))
124                 <a href="{{ $chapter->getUrl('/permissions') }}" class="icon-list-item">
125                     <span>@icon('lock')</span>
126                     <span>{{ trans('entities.permissions') }}</span>
127                 </a>
128             @endif
129             @if(userCan('chapter-delete', $chapter))
130                 <a href="{{ $chapter->getUrl('/delete') }}" class="icon-list-item">
131                     <span>@icon('delete')</span>
132                     <span>{{ trans('common.delete') }}</span>
133                 </a>
134             @endif
135
136             <hr class="primary-background"/>
137
138             @if(signedInUser())
139                 @include('entities.favourite-action', ['entity' => $chapter])
140             @endif
141             @if(userCan('content-export'))
142                 @include('entities.export-menu', ['entity' => $chapter])
143             @endif
144         </div>
145     </div>
146 @stop
147
148 @section('left')
149
150     @include('entities.search-form', ['label' => trans('entities.chapters_search_this')])
151
152     @if($chapter->tags->count() > 0)
153         <div class="mb-xl">
154             @include('entities.tag-list', ['entity' => $chapter])
155         </div>
156     @endif
157
158     @include('entities.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
159 @stop
160
161