]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
66c3762a89f675bd0d2083864a1fafb44df81d38
[bookstack] / resources / views / pages / show.blade.php
1 @extends('layouts.tri')
2
3 @push('social-meta')
4     <meta property="og:description" content="{{ Str::limit($page->text, 100, '...') }}">
5 @endpush
6
7 @include('entities.body-tag-classes', ['entity' => $page])
8
9 @section('body')
10
11     <div class="mb-m print-hidden">
12         @include('entities.breadcrumbs', ['crumbs' => [
13             $page->book,
14             $page->hasChapter() ? $page->chapter : null,
15             $page,
16         ]])
17     </div>
18
19     <main class="content-wrap card">
20         <div class="page-content clearfix" page-display="{{ $page->id }}">
21             @include('pages.parts.page-display')
22         </div>
23         @include('pages.parts.pointer', ['page' => $page])
24     </main>
25
26     @include('entities.sibling-navigation', ['next' => $next, 'previous' => $previous])
27
28     @if ($commentsEnabled)
29         @if(($previous || $next))
30             <div class="px-xl">
31                 <hr class="darker">
32             </div>
33         @endif
34
35         <div class="px-xl comments-container mb-l print-hidden">
36             @include('comments.comments', ['page' => $page])
37             <div class="clearfix"></div>
38         </div>
39     @endif
40 @stop
41
42 @section('left')
43
44     @if($page->tags->count() > 0)
45         <section>
46             @include('entities.tag-list', ['entity' => $page])
47         </section>
48     @endif
49
50     @if ($page->attachments->count() > 0)
51         <div id="page-attachments" class="mb-l">
52             <h5>{{ trans('entities.pages_attachments') }}</h5>
53             <div class="body">
54                 @include('attachments.list', ['attachments' => $page->attachments])
55             </div>
56         </div>
57     @endif
58
59     @if (isset($pageNav) && count($pageNav))
60         <nav id="page-navigation" class="mb-xl" aria-label="{{ trans('entities.pages_navigation') }}">
61             <h5>{{ trans('entities.pages_navigation') }}</h5>
62             <div class="body">
63                 <div class="sidebar-page-nav menu">
64                     @foreach($pageNav as $navItem)
65                         <li class="page-nav-item h{{ $navItem['level'] }}">
66                             <a href="{{ $navItem['link'] }}" class="text-limit-lines-1 block">{{ $navItem['text'] }}</a>
67                             <div class="primary-background sidebar-page-nav-bullet"></div>
68                         </li>
69                     @endforeach
70                 </div>
71             </div>
72         </nav>
73     @endif
74
75     @include('entities.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
76 @stop
77
78 @section('right')
79     <div id="page-details" class="entity-details mb-xl">
80         <h5>{{ trans('common.details') }}</h5>
81         <div class="blended-links">
82             @include('entities.meta', ['entity' => $page])
83
84             @if($book->hasPermissions())
85                 <div class="active-restriction">
86                     @if(userCan('restrictions-manage', $book))
87                         <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
88                             @icon('lock')
89                             <div>{{ trans('entities.books_permissions_active') }}</div>
90                         </a>
91                     @else
92                         <div class="entity-meta-item">
93                             @icon('lock')
94                             <div>{{ trans('entities.books_permissions_active') }}</div>
95                         </div>
96                     @endif
97                 </div>
98             @endif
99
100             @if($page->chapter && $page->chapter->hasPermissions())
101                 <div class="active-restriction">
102                     @if(userCan('restrictions-manage', $page->chapter))
103                         <a href="{{ $page->chapter->getUrl('/permissions') }}" class="entity-meta-item">
104                             @icon('lock')
105                             <div>{{ trans('entities.chapters_permissions_active') }}</div>
106                         </a>
107                     @else
108                         <div class="entity-meta-item">
109                             @icon('lock')
110                             <div>{{ trans('entities.chapters_permissions_active') }}</div>
111                         </div>
112                     @endif
113                 </div>
114             @endif
115
116             @if($page->hasPermissions())
117                 <div class="active-restriction">
118                     @if(userCan('restrictions-manage', $page))
119                         <a href="{{ $page->getUrl('/permissions') }}" class="entity-meta-item">
120                             @icon('lock')
121                             <div>{{ trans('entities.pages_permissions_active') }}</div>
122                         </a>
123                     @else
124                         <div class="entity-meta-item">
125                             @icon('lock')
126                             <div>{{ trans('entities.pages_permissions_active') }}</div>
127                         </div>
128                     @endif
129                 </div>
130             @endif
131
132             @if($page->template)
133                 <div class="entity-meta-item">
134                     @icon('template')
135                     <div>{{ trans('entities.pages_is_template') }}</div>
136                 </div>
137             @endif
138         </div>
139     </div>
140
141     <div class="actions mb-xl">
142         <h5>{{ trans('common.actions') }}</h5>
143
144         <div class="icon-list text-primary">
145
146             {{--User Actions--}}
147             @if(userCan('page-update', $page))
148                 <a href="{{ $page->getUrl('/edit') }}" class="icon-list-item">
149                     <span>@icon('edit')</span>
150                     <span>{{ trans('common.edit') }}</span>
151                 </a>
152             @endif
153             @if(userCanOnAny('create', \BookStack\Entities\Models\Book::class) || userCanOnAny('create', \BookStack\Entities\Models\Chapter::class) || userCan('page-create-all') || userCan('page-create-own'))
154                 <a href="{{ $page->getUrl('/copy') }}" class="icon-list-item">
155                     <span>@icon('copy')</span>
156                     <span>{{ trans('common.copy') }}</span>
157                 </a>
158             @endif
159             @if(userCan('page-update', $page))
160                 @if(userCan('page-delete', $page))
161                         <a href="{{ $page->getUrl('/move') }}" class="icon-list-item">
162                             <span>@icon('folder')</span>
163                             <span>{{ trans('common.move') }}</span>
164                         </a>
165                 @endif
166             @endif
167             <a href="{{ $page->getUrl('/revisions') }}" class="icon-list-item">
168                 <span>@icon('history')</span>
169                 <span>{{ trans('entities.revisions') }}</span>
170             </a>
171             @if(userCan('restrictions-manage', $page))
172                 <a href="{{ $page->getUrl('/permissions') }}" class="icon-list-item">
173                     <span>@icon('lock')</span>
174                     <span>{{ trans('entities.permissions') }}</span>
175                 </a>
176             @endif
177             @if(userCan('page-delete', $page))
178                 <a href="{{ $page->getUrl('/delete') }}" class="icon-list-item">
179                     <span>@icon('delete')</span>
180                     <span>{{ trans('common.delete') }}</span>
181                 </a>
182             @endif
183
184             <hr class="primary-background"/>
185
186             @if(signedInUser())
187                 @include('entities.favourite-action', ['entity' => $page])
188             @endif
189             @if(userCan('content-export'))
190                 @include('entities.export-menu', ['entity' => $page])
191             @endif
192         </div>
193
194     </div>
195 @stop