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