]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/show.blade.php
Added markdown export endpoints to API
[bookstack] / resources / views / chapters / show.blade.php
1 @extends('tri-layout')
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 @section('body')
10
11     <div class="mb-m print-hidden">
12         @include('partials.breadcrumbs', ['crumbs' => [
13             $chapter->book,
14             $chapter,
15         ]])
16     </div>
17
18     <main class="content-wrap card">
19         <h1 class="break-text">{{ $chapter->name }}</h1>
20         <div refs="entity-search@contentView" class="chapter-content">
21             <p class="text-muted break-text">{!! nl2br(e($chapter->description)) !!}</p>
22             @if(count($pages) > 0)
23                 <div class="entity-list book-contents">
24                     @foreach($pages as $page)
25                         @include('pages.list-item', ['page' => $page])
26                     @endforeach
27                 </div>
28             @else
29                 <div class="mt-xl">
30                     <hr>
31                     <p class="text-muted italic mb-m mt-xl">{{ trans('entities.chapters_empty') }}</p>
32
33                     <div class="icon-list block inline">
34                         @if(userCan('page-create', $chapter))
35                             <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item text-page">
36                                 <span class="icon">@icon('page')</span>
37                                 <span>{{ trans('entities.books_empty_create_page') }}</span>
38                             </a>
39                         @endif
40                         @if(userCan('book-update', $book))
41                             <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item text-book">
42                                 <span class="icon">@icon('book')</span>
43                                 <span>{{ trans('entities.books_empty_sort_current_book') }}</span>
44                             </a>
45                         @endif
46                     </div>
47
48                 </div>
49             @endif
50         </div>
51
52         @include('partials.entity-search-results')
53     </main>
54
55     @include('partials.entity-sibling-navigation', ['next' => $next, 'previous' => $previous])
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             @if(userCan('page-create', $chapter))
93                 <a href="{{ $chapter->getUrl('/create-page') }}" class="icon-list-item">
94                     <span>@icon('add')</span>
95                     <span>{{ trans('entities.pages_new') }}</span>
96                 </a>
97             @endif
98
99             <hr class="primary-background"/>
100
101             @if(userCan('chapter-update', $chapter))
102                 <a href="{{ $chapter->getUrl('/edit') }}" class="icon-list-item">
103                     <span>@icon('edit')</span>
104                     <span>{{ trans('common.edit') }}</span>
105                 </a>
106             @endif
107             @if(userCan('chapter-update', $chapter) && userCan('chapter-delete', $chapter))
108                 <a href="{{ $chapter->getUrl('/move') }}" class="icon-list-item">
109                     <span>@icon('folder')</span>
110                     <span>{{ trans('common.move') }}</span>
111                 </a>
112             @endif
113             @if(userCan('restrictions-manage', $chapter))
114                 <a href="{{ $chapter->getUrl('/permissions') }}" class="icon-list-item">
115                     <span>@icon('lock')</span>
116                     <span>{{ trans('entities.permissions') }}</span>
117                 </a>
118             @endif
119             @if(userCan('chapter-delete', $chapter))
120                 <a href="{{ $chapter->getUrl('/delete') }}" class="icon-list-item">
121                     <span>@icon('delete')</span>
122                     <span>{{ trans('common.delete') }}</span>
123                 </a>
124             @endif
125
126             <hr class="primary-background"/>
127
128             @if(signedInUser())
129                 @include('partials.entity-favourite-action', ['entity' => $chapter])
130             @endif
131             @include('partials.entity-export-menu', ['entity' => $chapter])
132         </div>
133     </div>
134 @stop
135
136 @section('left')
137
138     @include('partials.entity-search-form', ['label' => trans('entities.chapters_search_this')])
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     @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
147 @stop
148
149