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