]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
Finished migrated from icon-font to SVG
[bookstack] / resources / views / pages / show.blade.php
1 @extends('sidebar-layout')
2
3 @section('toolbar')
4     <div class="col-sm-8 col-xs-5 faded">
5         @include('pages._breadcrumbs', ['page' => $page])
6     </div>
7     <div class="col-sm-4 col-xs-7 faded">
8         <div class="action-buttons">
9             <span dropdown class="dropdown-container">
10                 <div dropdown-toggle class="text-button text-primary">@icon('export'){{ trans('entities.export') }}</div>
11                 <ul class="wide">
12                     <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
13                     <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
14                     <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
15                 </ul>
16             </span>
17             @if(userCan('page-update', $page))
18                 <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" >@icon('edit'){{ trans('common.edit') }}</a>
19             @endif
20             @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
21                 <div dropdown class="dropdown-container">
22                     <a dropdown-toggle class="text-primary text-button">@icon('more') {{ trans('common.more') }}</a>
23                     <ul>
24                         @if(userCan('page-update', $page))
25                             <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" >@icon('folder'){{ trans('common.move') }}</a></li>
26                             <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary">@icon('history'){{ trans('entities.revisions') }}</a></li>
27                         @endif
28                         @if(userCan('restrictions-manage', $page))
29                             <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary">@icon('lock'){{ trans('entities.permissions') }}</a></li>
30                         @endif
31                         @if(userCan('page-delete', $page))
32                             <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg">@icon('delete'){{ trans('common.delete') }}</a></li>
33                         @endif
34                     </ul>
35                 </div>
36             @endif
37
38         </div>
39     </div>
40 @stop
41
42 @section('sidebar')
43     @if($book->restricted || ($page->chapter && $page->chapter->restricted) || $page->restricted)
44         <div class="card">
45             <h3>@icon('permission') {{ trans('entities.permissions') }}</h3>
46             <div class="body">
47                 <div class="text-muted">
48
49                     @if($book->restricted)
50                         @if(userCan('restrictions-manage', $book))
51                             <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
52                         @else
53                             @icon('lock'){{ trans('entities.books_permissions_active') }}
54                         @endif
55                         <br>
56                     @endif
57
58                     @if($page->chapter && $page->chapter->restricted)
59                         @if(userCan('restrictions-manage', $page->chapter))
60                             <a href="{{ $page->chapter->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.chapters_permissions_active') }}</a>
61                         @else
62                             @icon('lock'){{ trans('entities.chapters_permissions_active') }}
63                         @endif
64                         <br>
65                     @endif
66
67                     @if($page->restricted)
68                         @if(userCan('restrictions-manage', $page))
69                             <a href="{{ $page->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.pages_permissions_active') }}</a>
70                         @else
71                             @icon('lock'){{ trans('entities.pages_permissions_active') }}
72                         @endif
73                         <br>
74                     @endif
75                 </div>
76             </div>
77         </div>
78     @endif
79
80     @if($page->tags->count() > 0)
81         <div class="card tag-display">
82             <h3>@icon('tag') {{ trans('entities.page_tags') }}</h3>
83             <div class="body">
84                 <table>
85                     <tbody>
86                     @foreach($page->tags as $tag)
87                         <tr class="tag">
88                             <td @if(!$tag->value) colspan="2" @endif><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a></td>
89                             @if($tag->value) <td class="tag-value"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></td> @endif
90                         </tr>
91                     @endforeach
92                     </tbody>
93                 </table>
94             </div>
95         </div>
96     @endif
97
98     @if ($page->attachments->count() > 0)
99         <div class="card">
100             <h3>@icon('attach') {{ trans('entities.pages_attachments') }}</h3>
101             <div class="body">
102                 @foreach($page->attachments as $attachment)
103                     <div class="attachment">
104                         <a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif>@icon($attachment->external ? 'export' : 'file'){{ $attachment->name }}</a>
105                     </div>
106                 @endforeach
107             </div>
108         </div>
109     @endif
110
111     @if (isset($pageNav) && count($pageNav))
112         <div class="card">
113             <h3>@icon('open-book') {{ trans('entities.pages_navigation') }}</h3>
114             <div class="body">
115                 <div class="sidebar-page-nav menu">
116                     @foreach($pageNav as $navItem)
117                         <li class="page-nav-item h{{ $navItem['level'] }}">
118                             <a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
119                         </li>
120                     @endforeach
121                 </div>
122             </div>
123         </div>
124     @endif
125
126     <div class="card">
127         <h3>@icon('info') {{ trans('common.details') }}</h3>
128         <div class="body">
129             @include('partials.entity-meta', ['entity' => $page])
130         </div>
131     </div>
132
133     @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
134
135 @stop
136
137 @section('body')
138     <div class="page-content" ng-non-bindable>
139
140         <div class="pointer-container" id="pointer">
141             <div class="pointer anim" >
142                 <span class="icon text-primary">@icon('link') @icon('include', ['style' => 'display:none;'])</span>
143                 <input readonly="readonly" type="text" id="pointer-url" placeholder="url">
144                 <button class="button icon" data-clipboard-target="#pointer-url" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
145             </div>
146         </div>
147
148         @include('pages/page-display')
149
150     </div>
151     @if ($commentsEnabled)
152       <div class="container small nopad">
153           @include('comments/comments', ['page' => $page])
154       </div>
155     @endif
156 @stop
157
158 @section('scripts')
159     <script>
160         setupPageShow({{$page->id}});
161     </script>
162 @stop