]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Fixed failing test after drawio default url change
[bookstack] / resources / views / books / show.blade.php
1 @extends('layouts.tri')
2
3 @section('container-attrs')
4     component="entity-search"
5     option:entity-search:entity-id="{{ $book->id }}"
6     option:entity-search:entity-type="book"
7 @stop
8
9 @push('social-meta')
10     <meta property="og:description" content="{{ Str::limit($book->description, 100, '...') }}">
11     @if($book->cover)
12         <meta property="og:image" content="{{ $book->getBookCover() }}">
13     @endif
14 @endpush
15
16 @section('body')
17
18     <div class="mb-s">
19         @include('entities.breadcrumbs', ['crumbs' => [
20             $book,
21         ]])
22     </div>
23
24     <main class="content-wrap card">
25         <h1 class="break-text">{{$book->name}}</h1>
26         <div refs="entity-search@contentView" class="book-content">
27             <p class="text-muted">{!! nl2br(e($book->description)) !!}</p>
28             @if(count($bookChildren) > 0)
29                 <div class="entity-list book-contents">
30                     @foreach($bookChildren as $childElement)
31                         @if($childElement->isA('chapter'))
32                             @include('chapters.parts.list-item', ['chapter' => $childElement])
33                         @else
34                             @include('pages.parts.list-item', ['page' => $childElement])
35                         @endif
36                     @endforeach
37                 </div>
38             @else
39                 <div class="mt-xl">
40                     <hr>
41                     <p class="text-muted italic mb-m mt-xl">{{ trans('entities.books_empty_contents') }}</p>
42
43                     <div class="icon-list block inline">
44                         @if(userCan('page-create', $book))
45                             <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item text-page">
46                                 <span class="icon">@icon('page')</span>
47                                 <span>{{ trans('entities.books_empty_create_page') }}</span>
48                             </a>
49                         @endif
50                         @if(userCan('chapter-create', $book))
51                             <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item text-chapter">
52                                 <span class="icon">@icon('chapter')</span>
53                                 <span>{{ trans('entities.books_empty_add_chapter') }}</span>
54                             </a>
55                         @endif
56                     </div>
57
58                 </div>
59             @endif
60         </div>
61
62         @include('entities.search-results')
63     </main>
64
65 @stop
66
67 @section('right')
68     <div class="mb-xl">
69         <h5>{{ trans('common.details') }}</h5>
70         <div class="text-small text-muted blended-links">
71             @include('entities.meta', ['entity' => $book])
72             @if($book->restricted)
73                 <div class="active-restriction">
74                     @if(userCan('restrictions-manage', $book))
75                         <a href="{{ $book->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.books_permissions_active') }}</a>
76                     @else
77                         @icon('lock'){{ trans('entities.books_permissions_active') }}
78                     @endif
79                 </div>
80             @endif
81         </div>
82     </div>
83
84     <div class="actions mb-xl">
85         <h5>{{ trans('common.actions') }}</h5>
86         <div class="icon-list text-primary">
87
88             @if(userCan('page-create', $book))
89                 <a href="{{ $book->getUrl('/create-page') }}" class="icon-list-item">
90                     <span>@icon('add')</span>
91                     <span>{{ trans('entities.pages_new') }}</span>
92                 </a>
93             @endif
94             @if(userCan('chapter-create', $book))
95                 <a href="{{ $book->getUrl('/create-chapter') }}" class="icon-list-item">
96                     <span>@icon('add')</span>
97                     <span>{{ trans('entities.chapters_new') }}</span>
98                 </a>
99             @endif
100
101             <hr class="primary-background">
102
103             @if(userCan('book-update', $book))
104                 <a href="{{ $book->getUrl('/edit') }}" class="icon-list-item">
105                     <span>@icon('edit')</span>
106                     <span>{{ trans('common.edit') }}</span>
107                 </a>
108                 <a href="{{ $book->getUrl('/sort') }}" class="icon-list-item">
109                     <span>@icon('sort')</span>
110                     <span>{{ trans('common.sort') }}</span>
111                 </a>
112             @endif
113             @if(userCan('book-create-all'))
114                 <a href="{{ $book->getUrl('/copy') }}" class="icon-list-item">
115                     <span>@icon('copy')</span>
116                     <span>{{ trans('common.copy') }}</span>
117                 </a>
118             @endif
119             @if(userCan('restrictions-manage', $book))
120                 <a href="{{ $book->getUrl('/permissions') }}" class="icon-list-item">
121                     <span>@icon('lock')</span>
122                     <span>{{ trans('entities.permissions') }}</span>
123                 </a>
124             @endif
125             @if(userCan('book-delete', $book))
126                 <a href="{{ $book->getUrl('/delete') }}" class="icon-list-item">
127                     <span>@icon('delete')</span>
128                     <span>{{ trans('common.delete') }}</span>
129                 </a>
130             @endif
131
132             <hr class="primary-background">
133
134             @if(signedInUser())
135                 @include('entities.favourite-action', ['entity' => $book])
136             @endif
137             @if(userCan('content-export'))
138                 @include('entities.export-menu', ['entity' => $book])
139             @endif
140         </div>
141     </div>
142
143 @stop
144
145 @section('left')
146
147     @include('entities.search-form', ['label' => trans('entities.books_search_this')])
148
149     @if($book->tags->count() > 0)
150         <div class="mb-xl">
151             @include('entities.tag-list', ['entity' => $book])
152         </div>
153     @endif
154
155     @if(count($bookParentShelves) > 0)
156         <div class="actions mb-xl">
157             <h5>{{ trans('entities.shelves_long') }}</h5>
158             @include('entities.list', ['entities' => $bookParentShelves, 'style' => 'compact'])
159         </div>
160     @endif
161
162     @if(count($activity) > 0)
163         <div class="mb-xl">
164             <h5>{{ trans('entities.recent_activity') }}</h5>
165             @include('common.activity-list', ['activity' => $activity])
166         </div>
167     @endif
168 @stop
169