]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Updated standard entity lists
[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="well">
33                     {{--TODO--}}
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 page">@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 chapter">@icon('chapter'){{ trans('entities.books_empty_add_chapter') }}</a>
43                     @endif
44                 </div>
45             @endif
46         </div>
47
48         <div class="search-results" v-cloak v-show="searching">
49             {{--TODO--}}
50             <h3 class="text-muted">{{ trans('entities.search_results') }} <a v-if="searching" v-on:click="clearSearch()" class="text-small">@icon('close'){{ trans('entities.search_clear') }}</a></h3>
51             <div v-if="!searchResults">
52                 @include('partials.loading-icon')
53             </div>
54             <div v-html="searchResults"></div>
55         </div>
56     </div>
57
58 @stop
59
60
61 @section('right')
62
63     <div class="actions mb-xl">
64         <h5>{{ trans('common.actions') }}</h5>
65         <div class="icon-list text-primary">
66             <div dropdown class="dropdown-container">
67                 <div dropdown-toggle class="icon-list-item">
68                     <span>@icon('export')</span>
69                     <span>{{ trans('entities.export') }}</span>
70                 </div>
71                 <ul class="wide">
72                     <li><a href="{{ $book->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
73                     <li><a href="{{ $book->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
74                     <li><a href="{{ $book->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>
75                 </ul>
76             </div>
77
78             @if(userCan('page-create', $book))
79                 <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item">
80                     <span>@icon('add')</span>
81                     <span>{{ trans('entities.pages_new') }}</span>
82                 </a>
83             @endif
84             @if(userCan('chapter-create', $book))
85                 <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item">
86                     <span>@icon('add')</span>
87                     <span>{{ trans('entities.chapters_new') }}</span>
88                 </a>
89             @endif
90             @if(userCan('book-update', $book))
91                 <a href="{{ $book->getUrl('/edit') }}" class="icon-list-item">
92                     <span>@icon('edit')</span>
93                     <span>{{ trans('common.edit') }}</span>
94                 </a>
95                 <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item">
96                     <span>@icon('sort')</span>
97                     <span>{{ trans('common.sort') }}</span>
98                 </a>
99             @endif
100             @if(userCan('restrictions-manage', $book))
101                 <a href="{{ $book->getUrl('/permissions') }}" class="icon-list-item">
102                     <span>@icon('lock')</span>
103                     <span>{{ trans('entities.permissions') }}</span>
104                 </a>
105             @endif
106             @if(userCan('book-delete', $book))
107                 <a href="{{ $book->getUrl('/delete') }}" class="icon-list-item">
108                     <span>@icon('delete')</span>
109                     <span>{{ trans('common.delete') }}</span>
110                 </a>
111             @endif
112         </div>
113     </div>
114
115 @stop
116
117 @section('left')
118
119     @if($book->tags->count() > 0)
120         <div class="mb-xl">
121             @include('components.tag-list', ['entity' => $book])
122         </div>
123     @endif
124
125     <div class="mb-xl">
126         <form v-on:submit.prevent="searchBook" class="search-box">
127             <input v-model="searchTerm" v-on:change="checkSearchForm()" type="text" name="term" placeholder="{{ trans('entities.books_search_this') }}">
128             <button type="submit">@icon('search')</button>
129             <button v-if="searching" v-cloak class="text-neg" v-on:click="clearSearch()" type="button">@icon('close')</button>
130         </form>
131     </div>
132
133     <div class="mb-xl">
134         <h5>{{ trans('common.details') }}</h5>
135         <div class="text-small text-muted blended-links">
136             @include('partials.entity-meta', ['entity' => $book])
137             @if($book->restricted)
138                 <div class="active-restriction">
139                     @if(userCan('restrictions-manage', $book))
140                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
141                     @else
142                         @icon('lock'){{ trans('entities.books_permissions_active') }}
143                     @endif
144                 </div>
145             @endif
146         </div>
147     </div>
148
149     @if(count($activity) > 0)
150         <div class="mb-xl">
151             <h5>{{ trans('entities.recent_activity') }}</h5>
152             @include('partials.activity-list', ['activity' => $activity])
153         </div>
154     @endif
155 @stop
156