]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
af610e3584c93e6f1beda1c31842f95d7e16291c
[bookstack] / resources / views / pages / show.blade.php
1 @extends('tri-layout')
2
3 @section('body')
4
5     <div class="mb-m">
6         @include('pages._breadcrumbs', ['page' => $page])
7     </div>
8
9     <div class="content-wrap card">
10         <div class="page-content flex" page-display="{{ $page->id }}">
11
12             <div class="pointer-container" id="pointer">
13                 <div class="pointer anim {{ userCan('page-update', $page) ? 'is-page-editable' : ''}}" >
14                     <span class="icon text-primary">@icon('link') @icon('include', ['style' => 'display:none;'])</span>
15                     <span class="input-group">
16                     <input readonly="readonly" type="text" id="pointer-url" placeholder="url">
17                     <button class="button icon" data-clipboard-target="#pointer-url" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
18                 </span>
19                     @if(userCan('page-update', $page))
20                         <a href="{{ $page->getUrl('/edit') }}" id="pointer-edit" data-edit-href="{{ $page->getUrl('/edit') }}"
21                            class="button icon heading-edit-icon" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit')</a>
22                     @endif
23                 </div>
24             </div>
25
26             @include('pages.page-display')
27         </div>
28     </div>
29
30     @if ($commentsEnabled)
31         <div class="container small nopad comments-container mb-l">
32             @include('comments.comments', ['page' => $page])
33             <div class="clearfix"></div>
34         </div>
35     @endif
36 @stop
37
38 @section('left')
39
40     @if($page->tags->count() > 0)
41         <section>
42             @include('components.tag-list', ['entity' => $page])
43         </section>
44     @endif
45
46     @if ($page->attachments->count() > 0)
47         <div id="page-attachments" class="mb-xl">
48             <h5>{{ trans('entities.pages_attachments') }}</h5>
49             <div class="body">
50                 @foreach($page->attachments as $attachment)
51                     <div class="attachment">
52                         <a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif>@icon($attachment->external ? 'export' : 'file'){{ $attachment->name }}</a>
53                     </div>
54                 @endforeach
55             </div>
56         </div>
57     @endif
58
59     @if (isset($pageNav) && count($pageNav))
60         <div id="page-navigation" class="mb-xl">
61             <h5>{{ trans('entities.pages_navigation') }}</h5>
62             <div class="body">
63                 <div class="sidebar-page-nav menu">
64                     @foreach($pageNav as $navItem)
65                         <li class="page-nav-item h{{ $navItem['level'] }}">
66                             <a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
67                             <div class="primary-background sidebar-page-nav-bullet"></div>
68                         </li>
69                     @endforeach
70                 </div>
71             </div>
72         </div>
73     @endif
74
75     <div id="page-details" class="entity-details mb-xl">
76         <h5>{{ trans('common.details') }}</h5>
77         <div class="body text-muted text-small blended-links">
78             @include('partials.entity-meta', ['entity' => $page])
79
80             @if($book->restricted)
81                 <div class="active-restriction">
82                     @if(userCan('restrictions-manage', $book))
83                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
84                     @else
85                         @icon('lock'){{ trans('entities.books_permissions_active') }}
86                     @endif
87                 </div>
88             @endif
89
90             @if($page->chapter && $page->chapter->restricted)
91                 <div class="active-restriction">
92                     @if(userCan('restrictions-manage', $page->chapter))
93                         <a href="{{ $page->chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
94                     @else
95                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
96                     @endif
97                 </div>
98             @endif
99
100             @if($page->restricted)
101                 <div class="active-restriction">
102                     @if(userCan('restrictions-manage', $page))
103                         <a href="{{ $page->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.pages_permissions_active') }}</a>
104                     @else
105                         @icon('lock'){{ trans('entities.pages_permissions_active') }}
106                     @endif
107                 </div>
108             @endif
109         </div>
110     </div>
111
112     @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
113 @stop
114
115 @section('right')
116     <div class="actions mb-xl">
117         <h5>Actions</h5>
118
119         <div class="icon-list text-primary">
120             {{--Export--}}
121             <div dropdown class="dropdown-container block">
122                 <div dropdown-toggle class="icon-list-item">
123                     <span>@icon('export')</span>
124                     <span>{{ trans('entities.export') }}</span>
125                 </div>
126                 <ul class="wide">
127                     <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
128                     <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
129                     <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
130                 </ul>
131             </div>
132
133             {{--User Actions--}}
134             @if(userCan('page-update', $page))
135                 <a href="{{ $page->getUrl('/edit') }}" class="icon-list-item">
136                     <span>@icon('edit')</span>
137                     <span>{{ trans('common.edit') }}</span>
138                 </a>
139                 <a href="{{ $page->getUrl('/copy') }}" class="icon-list-item">
140                     <span>@icon('copy')</span>
141                     <span>{{ trans('common.copy') }}</span>
142                 </a>
143                 @if(userCan('page-delete', $page))
144                         <a href="{{ $page->getUrl('/move') }}" class="icon-list-item">
145                             <span>@icon('folder')</span>
146                             <span>{{ trans('common.move') }}</span>
147                         </a>
148                 @endif
149                 <a href="{{ $page->getUrl('/revisions') }}" class="icon-list-item">
150                     <span>@icon('history')</span>
151                     <span>{{ trans('entities.revisions') }}</span>
152                 </a>
153             @endif
154             @if(userCan('restrictions-manage', $page))
155                 <a href="{{ $page->getUrl('/permissions') }}" class="icon-list-item">
156                     <span>@icon('lock')</span>
157                     <span>{{ trans('entities.permissions') }}</span>
158                 </a>
159             @endif
160             @if(userCan('page-delete', $page))
161                 <a href="{{ $page->getUrl('/delete') }}" class="icon-list-item">
162                     <span>@icon('delete')</span>
163                     <span>{{ trans('common.delete') }}</span>
164                 </a>
165             @endif
166         </div>
167
168     </div>
169 @stop