]> BookStack Code Mirror - bookstack/blob - resources/views/pages/show.blade.php
Add comment_add
[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                 @include('components.tag-list', ['entity' => $page])
85             </div>
86         </div>
87     @endif
88
89     @if ($page->attachments->count() > 0)
90         <div class="card">
91             <h3>@icon('attach') {{ trans('entities.pages_attachments') }}</h3>
92             <div class="body">
93                 @foreach($page->attachments as $attachment)
94                     <div class="attachment">
95                         <a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif>@icon($attachment->external ? 'export' : 'file'){{ $attachment->name }}</a>
96                     </div>
97                 @endforeach
98             </div>
99         </div>
100     @endif
101
102     @if (isset($pageNav) && count($pageNav))
103         <div class="card">
104             <h3>@icon('open-book') {{ trans('entities.pages_navigation') }}</h3>
105             <div class="body">
106                 <div class="sidebar-page-nav menu">
107                     @foreach($pageNav as $navItem)
108                         <li class="page-nav-item h{{ $navItem['level'] }}">
109                             <a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
110                         </li>
111                     @endforeach
112                 </div>
113             </div>
114         </div>
115     @endif
116
117     <div class="card">
118         <h3>@icon('info') {{ trans('common.details') }}</h3>
119         <div class="body">
120             @include('partials.entity-meta', ['entity' => $page])
121         </div>
122     </div>
123
124     @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
125
126 @stop
127
128 @section('body')
129     <div class="page-content" page-display="{{ $page->id }}" ng-non-bindable>
130
131         <div class="pointer-container" id="pointer">
132             <div class="pointer anim" >
133                 <span class="icon text-primary">@icon('link') @icon('include', ['style' => 'display:none;'])</span>
134                 <input readonly="readonly" type="text" id="pointer-url" placeholder="url">
135                 <button class="button icon" data-clipboard-target="#pointer-url" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
136             </div>
137         </div>
138
139         @include('pages/page-display')
140
141     </div>
142     @if ($commentsEnabled)
143       <div class="container small nopad">
144           @include('comments/comments', ['page' => $page])
145       </div>
146     @endif
147 @stop