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