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