]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
b33cb6715e3a630729d745b9352894126243413b
[bookstack] / resources / views / books / show.blade.php
1 @extends('tri-layout')
2
3 @section('container-attrs')
4     id="entity-dashboard"
5     entity-id="{{ $book->id }}"
6     entity-type="book"
7 @stop
8
9 @section('body')
10
11     <div class="mb-s">
12         @include('partials.breadcrumbs', ['crumbs' => [
13             $book,
14         ]])
15     </div>
16
17     <div class="content-wrap card">
18         <h1 class="break-text" v-pre>{{$book->name}}</h1>
19         <div class="book-content" v-show="!searching">
20             <p class="text-muted" v-pre>{!! nl2br(e($book->description)) !!}</p>
21             @if(count($bookChildren) > 0)
22                 <div class="entity-list book-contents" v-pre>
23                     @foreach($bookChildren as $childElement)
24                         @if($childElement->isA('chapter'))
25                             @include('chapters.list-item', ['chapter' => $childElement])
26                         @else
27                             @include('pages.list-item', ['page' => $childElement])
28                         @endif
29                     @endforeach
30                 </div>
31             @else
32                 <div>
33                     {{--TODO - Empty States --}}
34                     <p class="text-muted italic">{{ trans('entities.books_empty_contents') }}</p>
35                     @if(userCan('page-create', $book))
36                         <a href="{{ $book->getUrl('/create-page') }}" class="button outline">@icon('page'){{ trans('entities.books_empty_create_page') }}</a>
37                     @endif
38                     @if(userCan('page-create', $book) && userCan('chapter-create', $book))
39                         &nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp;&nbsp;
40                     @endif
41                     @if(userCan('chapter-create', $book))
42                         <a href="{{ $book->getUrl('/create-chapter') }}" class="button outline">@icon('chapter'){{ trans('entities.books_empty_add_chapter') }}</a>
43                     @endif
44                 </div>
45             @endif
46         </div>
47
48         @include('partials.entity-dashboard-search-results')
49     </div>
50
51 @stop
52
53
54 @section('right')
55
56     <div class="mb-xl">
57         <h5>{{ trans('common.details') }}</h5>
58         <div class="text-small text-muted blended-links">
59             @include('partials.entity-meta', ['entity' => $book])
60             @if($book->restricted)
61                 <div class="active-restriction">
62                     @if(userCan('restrictions-manage', $book))
63                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
64                     @else
65                         @icon('lock'){{ trans('entities.books_permissions_active') }}
66                     @endif
67                 </div>
68             @endif
69         </div>
70     </div>
71
72
73     <div class="actions mb-xl">
74         <h5>{{ trans('common.actions') }}</h5>
75         <div class="icon-list text-primary">
76             <div dropdown class="dropdown-container">
77                 <div dropdown-toggle class="icon-list-item">
78                     <span>@icon('export')</span>
79                     <span>{{ trans('entities.export') }}</span>
80                 </div>
81                 <ul class="wide">
82                     <li><a href="{{ $book->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
83                     <li><a href="{{ $book->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
84                     <li><a href="{{ $book->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
85                 </ul>
86             </div>
87
88             @if(userCan('page-create', $book))
89                 <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item">
90                     <span>@icon('add')</span>
91                     <span>{{ trans('entities.pages_new') }}</span>
92                 </a>
93             @endif
94             @if(userCan('chapter-create', $book))
95                 <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item">
96                     <span>@icon('add')</span>
97                     <span>{{ trans('entities.chapters_new') }}</span>
98                 </a>
99             @endif
100             @if(userCan('book-update', $book))
101                 <a href="{{ $book->getUrl('/edit') }}" class="icon-list-item">
102                     <span>@icon('edit')</span>
103                     <span>{{ trans('common.edit') }}</span>
104                 </a>
105                 <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item">
106                     <span>@icon('sort')</span>
107                     <span>{{ trans('common.sort') }}</span>
108                 </a>
109             @endif
110             @if(userCan('restrictions-manage', $book))
111                 <a href="{{ $book->getUrl('/permissions') }}" class="icon-list-item">
112                     <span>@icon('lock')</span>
113                     <span>{{ trans('entities.permissions') }}</span>
114                 </a>
115             @endif
116             @if(userCan('book-delete', $book))
117                 <a href="{{ $book->getUrl('/delete') }}" class="icon-list-item">
118                     <span>@icon('delete')</span>
119                     <span>{{ trans('common.delete') }}</span>
120                 </a>
121             @endif
122         </div>
123     </div>
124
125 @stop
126
127 @section('left')
128
129     @include('partials.entity-dashboard-search-box')
130
131     @if($book->tags->count() > 0)
132         <div class="mb-xl">
133             @include('components.tag-list', ['entity' => $book])
134         </div>
135     @endif
136
137     @if(count($activity) > 0)
138         <div class="mb-xl">
139             <h5>{{ trans('entities.recent_activity') }}</h5>
140             @include('partials.activity-list', ['activity' => $activity])
141         </div>
142     @endif
143 @stop
144