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