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