]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
510d69019232672f05bdb79b792155a40d737a1a
[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                         </li>
68                     @endforeach
69                 </div>
70             </div>
71         </div>
72     @endif
73
74     <div id="page-details" class="entity-details mb-xl">
75         <h5>{{ trans('common.details') }}</h5>
76         <div class="body text-muted text-small blended-links">
77             @include('partials.entity-meta', ['entity' => $page])
78
79             @if($book->restricted)
80                 <div class="active-restriction">
81                     @if(userCan('restrictions-manage', $book))
82                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
83                     @else
84                         @icon('lock'){{ trans('entities.books_permissions_active') }}
85                     @endif
86                 </div>
87             @endif
88
89             @if($page->chapter && $page->chapter->restricted)
90                 <div class="active-restriction">
91                     @if(userCan('restrictions-manage', $page->chapter))
92                         <a href="{{ $page->chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
93                     @else
94                         @icon('lock'){{ trans('entities.chapters_permissions_active') }}
95                     @endif
96                 </div>
97             @endif
98
99             @if($page->restricted)
100                 <div class="active-restriction">
101                     @if(userCan('restrictions-manage', $page))
102                         <a href="{{ $page->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.pages_permissions_active') }}</a>
103                     @else
104                         @icon('lock'){{ trans('entities.pages_permissions_active') }}
105                     @endif
106                 </div>
107             @endif
108         </div>
109     </div>
110
111     @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
112 @stop
113
114 @section('right')
115     <div class="actions mb-xl">
116         <h5>Actions</h5>
117
118         <div class="icon-list text-primary">
119             {{--Export--}}
120             <div dropdown class="dropdown-container block">
121                 <div dropdown-toggle class="icon-list-item">
122                     <span>@icon('export')</span>
123                     <span>{{ trans('entities.export') }}</span>
124                 </div>
125                 <ul class="wide">
126                     <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
127                     <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
128                     <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
129                 </ul>
130             </div>
131
132             {{--User Actions--}}
133             @if(userCan('page-update', $page))
134                 <a href="{{ $page->getUrl('/edit') }}" class="icon-list-item">
135                     <span>@icon('edit')</span>
136                     <span>{{ trans('common.edit') }}</span>
137                 </a>
138                 <a href="{{ $page->getUrl('/copy') }}" class="icon-list-item">
139                     <span>@icon('copy')</span>
140                     <span>{{ trans('common.copy') }}</span>
141                 </a>
142                 @if(userCan('page-delete', $page))
143                         <a href="{{ $page->getUrl('/move') }}" class="icon-list-item">
144                             <span>@icon('folder')</span>
145                             <span>{{ trans('common.move') }}</span>
146                         </a>
147                 @endif
148                 <a href="{{ $page->getUrl('/revisions') }}" class="icon-list-item">
149                     <span>@icon('history')</span>
150                     <span>{{ trans('entities.revisions') }}</span>
151                 </a>
152             @endif
153             @if(userCan('restrictions-manage', $page))
154                 <a href="{{ $page->getUrl('/permissions') }}" class="icon-list-item">
155                     <span>@icon('lock')</span>
156                     <span>{{ trans('entities.permissions') }}</span>
157                 </a>
158             @endif
159             @if(userCan('page-delete', $page))
160                 <a href="{{ $page->getUrl('/delete') }}" class="icon-list-item">
161                     <span>@icon('delete')</span>
162                     <span>{{ trans('common.delete') }}</span>
163                 </a>
164             @endif
165         </div>
166
167     </div>
168 @stop