]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Finished migrated from icon-font to SVG
[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('/page/create') }}" 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('/chapter/create') }}" 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->restricted)
57         <div class="card">
58             <h3>@icon('permission') {{ trans('entities.permissions') }}</h3>
59             <div class="body">
60                 <p class="text-muted">
61                     @if(userCan('restrictions-manage', $book))
62                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
63                     @else
64                         @icon('lock'){{ trans('entities.books_permissions_active') }}
65                     @endif
66                 </p>
67             </div>
68         </div>
69     @endif
70
71     @if(count($activity) > 0)
72         <div class="activity card">
73             <h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
74             @include('partials/activity-list', ['activity' => $activity])
75         </div>
76     @endif
77
78     <div class="card">
79         <h3>@icon('info') {{ trans('common.details') }}</h3>
80         <div class="body">
81             @include('partials.entity-meta', ['entity' => $book])
82         </div>
83     </div>
84 @stop
85
86 @section('container-attrs')
87     id="entity-dashboard"
88     entity-id="{{ $book->id }}"
89     entity-type="book"
90 @stop
91
92 @section('body')
93
94     <div class="container small">
95         <h1>{{$book->name}}</h1>
96         <div class="book-content" v-show="!searching">
97             <p class="text-muted" v-pre>{!! nl2br(e($book->description)) !!}</p>
98             @if(count($bookChildren) > 0)
99             <div class="page-list" v-pre>
100                 <hr>
101                 @foreach($bookChildren as $childElement)
102                     @if($childElement->isA('chapter'))
103                         @include('chapters/list-item', ['chapter' => $childElement])
104                     @else
105                         @include('pages/list-item', ['page' => $childElement])
106                     @endif
107                     <hr>
108                 @endforeach
109             </div>
110             @else
111                 <div class="well">
112                     <p class="text-muted italic">{{ trans('entities.books_empty_contents') }}</p>
113                         @if(userCan('page-create', $book))
114                             <a href="{{ $book->getUrl('/page/create') }}" class="button outline page">@icon('page'){{ trans('entities.books_empty_create_page') }}</a>
115                         @endif
116                         @if(userCan('page-create', $book) && userCan('chapter-create', $book))
117                             &nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp;&nbsp;
118                         @endif
119                         @if(userCan('chapter-create', $book))
120                             <a href="{{ $book->getUrl('/chapter/create') }}" class="button outline chapter">@icon('chapter'){{ trans('entities.books_empty_add_chapter') }}</a>
121                         @endif
122                 </div>
123             @endif
124
125         </div>
126         <div class="search-results" v-cloak v-show="searching">
127             <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>
128             <div v-if="!searchResults">
129                 @include('partials/loading-icon')
130             </div>
131             <div v-html="searchResults"></div>
132         </div>
133     </div>
134
135 @stop