]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
Fixes padding issues of the sidebar's items
[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="body text-small 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') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
86                     @else
87                         @icon('lock'){{ trans('entities.books_permissions_active') }}
88                     @endif
89                 </div>
90             @endif
91
92             @if($page->chapter && $page->chapter->restricted)
93                 <div class="active-restriction">
94                     @if(userCan('restrictions-manage', $page->chapter))
95                         <a href="{{ $page->chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
96                     @else
97                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
98                     @endif
99                 </div>
100             @endif
101
102             @if($page->restricted)
103                 <div class="active-restriction">
104                     @if(userCan('restrictions-manage', $page))
105                         <a href="{{ $page->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.pages_permissions_active') }}</a>
106                     @else
107                         @icon('lock'){{ trans('entities.pages_permissions_active') }}
108                     @endif
109                 </div>
110             @endif
111
112             @if($page->template)
113                 <div>
114                     @icon('template'){{ trans('entities.pages_is_template') }}
115                 </div>
116             @endif
117         </div>
118     </div>
119
120     <div class="actions mb-xl">
121         <h5>{{ trans('common.actions') }}</h5>
122
123         <div class="icon-list text-primary">
124
125             {{--User Actions--}}
126             @if(userCan('page-update', $page))
127                 <a href="{{ $page->getUrl('/edit') }}" class="icon-list-item">
128                     <span>@icon('edit')</span>
129                     <span>{{ trans('common.edit') }}</span>
130                 </a>
131             @endif
132             @if(userCanOnAny('page-create'))
133                 <a href="{{ $page->getUrl('/copy') }}" class="icon-list-item">
134                     <span>@icon('copy')</span>
135                     <span>{{ trans('common.copy') }}</span>
136                 </a>
137             @endif
138             @if(userCan('page-update', $page))
139                 @if(userCan('page-delete', $page))
140                         <a href="{{ $page->getUrl('/move') }}" class="icon-list-item">
141                             <span>@icon('folder')</span>
142                             <span>{{ trans('common.move') }}</span>
143                         </a>
144                 @endif
145                 <a href="{{ $page->getUrl('/revisions') }}" class="icon-list-item">
146                     <span>@icon('history')</span>
147                     <span>{{ trans('entities.revisions') }}</span>
148                 </a>
149             @endif
150             @if(userCan('restrictions-manage', $page))
151                 <a href="{{ $page->getUrl('/permissions') }}" class="icon-list-item">
152                     <span>@icon('lock')</span>
153                     <span>{{ trans('entities.permissions') }}</span>
154                 </a>
155             @endif
156             @if(userCan('page-delete', $page))
157                 <a href="{{ $page->getUrl('/delete') }}" class="icon-list-item">
158                     <span>@icon('delete')</span>
159                     <span>{{ trans('common.delete') }}</span>
160                 </a>
161             @endif
162
163             <hr class="primary-background"/>
164
165             @if(signedInUser())
166                 @include('entities.favourite-action', ['entity' => $page])
167             @endif
168             @if(userCan('content-export'))
169                 @include('entities.export-menu', ['entity' => $page])
170             @endif
171         </div>
172
173     </div>
174 @stop