]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Updated empty container item states
[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 class="mt-xl" v-pre>
33                     <hr>
34                     <p class="text-muted italic mb-m mt-xl">{{ trans('entities.books_empty_contents') }}</p>
35
36                     <div class="icon-list block inline">
37                         @if(userCan('page-create', $book))
38                             <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item text-page">
39                                 <span class="icon">@icon('page')</span>
40                                 <span>{{ trans('entities.books_empty_create_page') }}</span>
41                             </a>
42                         @endif
43                         @if(userCan('chapter-create', $book))
44                             <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item text-chapter">
45                                 <span class="icon">@icon('chapter')</span>
46                                 <span>{{ trans('entities.books_empty_add_chapter') }}</span>
47                             </a>
48                         @endif
49                     </div>
50
51                 </div>
52             @endif
53         </div>
54
55         @include('partials.entity-dashboard-search-results')
56     </div>
57
58 @stop
59
60
61 @section('right')
62
63     <div class="mb-xl">
64         <h5>{{ trans('common.details') }}</h5>
65         <div class="text-small text-muted blended-links">
66             @include('partials.entity-meta', ['entity' => $book])
67             @if($book->restricted)
68                 <div class="active-restriction">
69                     @if(userCan('restrictions-manage', $book))
70                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
71                     @else
72                         @icon('lock'){{ trans('entities.books_permissions_active') }}
73                     @endif
74                 </div>
75             @endif
76         </div>
77     </div>
78
79
80     <div class="actions mb-xl">
81         <h5>{{ trans('common.actions') }}</h5>
82         <div class="icon-list text-primary">
83             <div dropdown class="dropdown-container">
84                 <div dropdown-toggle class="icon-list-item">
85                     <span>@icon('export')</span>
86                     <span>{{ trans('entities.export') }}</span>
87                 </div>
88                 <ul class="wide">
89                     <li><a href="{{ $book->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
90                     <li><a href="{{ $book->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
91                     <li><a href="{{ $book->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
92                 </ul>
93             </div>
94
95             @if(userCan('page-create', $book))
96                 <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item">
97                     <span>@icon('add')</span>
98                     <span>{{ trans('entities.pages_new') }}</span>
99                 </a>
100             @endif
101             @if(userCan('chapter-create', $book))
102                 <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item">
103                     <span>@icon('add')</span>
104                     <span>{{ trans('entities.chapters_new') }}</span>
105                 </a>
106             @endif
107             @if(userCan('book-update', $book))
108                 <a href="{{ $book->getUrl('/edit') }}" class="icon-list-item">
109                     <span>@icon('edit')</span>
110                     <span>{{ trans('common.edit') }}</span>
111                 </a>
112                 <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item">
113                     <span>@icon('sort')</span>
114                     <span>{{ trans('common.sort') }}</span>
115                 </a>
116             @endif
117             @if(userCan('restrictions-manage', $book))
118                 <a href="{{ $book->getUrl('/permissions') }}" class="icon-list-item">
119                     <span>@icon('lock')</span>
120                     <span>{{ trans('entities.permissions') }}</span>
121                 </a>
122             @endif
123             @if(userCan('book-delete', $book))
124                 <a href="{{ $book->getUrl('/delete') }}" class="icon-list-item">
125                     <span>@icon('delete')</span>
126                     <span>{{ trans('common.delete') }}</span>
127                 </a>
128             @endif
129         </div>
130     </div>
131
132 @stop
133
134 @section('left')
135
136     @include('partials.entity-dashboard-search-box')
137
138     @if($book->tags->count() > 0)
139         <div class="mb-xl">
140             @include('components.tag-list', ['entity' => $book])
141         </div>
142     @endif
143
144     @if(count($activity) > 0)
145         <div class="mb-xl">
146             <h5>{{ trans('entities.recent_activity') }}</h5>
147             @include('partials.activity-list', ['activity' => $activity])
148         </div>
149     @endif
150 @stop
151