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