]> BookStack Code Mirror - bookstack/blob - resources/views/shelves/show.blade.php
Added additional testing for editor switching permissions
[bookstack] / resources / views / shelves / show.blade.php
1 @extends('layouts.tri')
2
3 @push('social-meta')
4     <meta property="og:description" content="{{ Str::limit($shelf->description, 100, '...') }}">
5     @if($shelf->cover)
6         <meta property="og:image" content="{{ $shelf->getBookCover() }}">
7     @endif
8 @endpush
9
10 @section('body')
11
12     <div class="mb-s">
13         @include('entities.breadcrumbs', ['crumbs' => [
14             $shelf,
15         ]])
16     </div>
17
18     <main class="card content-wrap">
19
20         <div class="flex-container-row wrap v-center">
21             <h1 class="flex fit-content break-text">{{ $shelf->name }}</h1>
22             <div class="flex"></div>
23             <div class="flex fit-content text-m-right my-m ml-m">
24                 @include('entities.sort', ['options' => [
25                     'default' => trans('common.sort_default'),
26                     'name' => trans('common.sort_name'),
27                     'created_at' => trans('common.sort_created_at'),
28                     'updated_at' => trans('common.sort_updated_at'),
29                 ], 'order' => $order, 'sort' => $sort, 'type' => 'shelf_books'])
30             </div>
31         </div>
32
33         <div class="book-content">
34             <p class="text-muted">{!! nl2br(e($shelf->description)) !!}</p>
35             @if(count($sortedVisibleShelfBooks) > 0)
36                 @if($view === 'list')
37                     <div class="entity-list">
38                         @foreach($sortedVisibleShelfBooks as $book)
39                             @include('books.parts.list-item', ['book' => $book])
40                         @endforeach
41                     </div>
42                 @else
43                     <div class="grid third">
44                         @foreach($sortedVisibleShelfBooks as $book)
45                             @include('entities.grid-item', ['entity' => $book])
46                         @endforeach
47                     </div>
48                 @endif
49             @else
50                 <div class="mt-xl">
51                     <hr>
52                     <p class="text-muted italic mt-xl mb-m">{{ trans('entities.shelves_empty_contents') }}</p>
53                     <div class="icon-list inline block">
54                         @if(userCan('book-create-all') && userCan('bookshelf-update', $shelf))
55                             <a href="{{ $shelf->getUrl('/create-book') }}" class="icon-list-item text-book">
56                                 <span class="icon">@icon('add')</span>
57                                 <span>{{ trans('entities.books_create') }}</span>
58                             </a>
59                         @endif
60                         @if(userCan('bookshelf-update', $shelf))
61                             <a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item text-bookshelf">
62                                 <span class="icon">@icon('edit')</span>
63                                 <span>{{ trans('entities.shelves_edit_and_assign') }}</span>
64                             </a>
65                         @endif
66                     </div>
67                 </div>
68             @endif
69         </div>
70     </main>
71
72 @stop
73
74 @section('left')
75
76     @if($shelf->tags->count() > 0)
77         <div id="tags" class="mb-xl">
78             @include('entities.tag-list', ['entity' => $shelf])
79         </div>
80     @endif
81
82     <div id="details" class="mb-xl">
83         <h5>{{ trans('common.details') }}</h5>
84         <div class="text-small text-muted blended-links">
85             @include('entities.meta', ['entity' => $shelf])
86             @if($shelf->restricted)
87                 <div class="active-restriction">
88                     @if(userCan('restrictions-manage', $shelf))
89                         <a href="{{ $shelf->getUrl('/permissions') }}">@icon('lock'){{ trans('entities.shelves_permissions_active') }}</a>
90                     @else
91                         @icon('lock'){{ trans('entities.shelves_permissions_active') }}
92                     @endif
93                 </div>
94             @endif
95         </div>
96     </div>
97
98     @if(count($activity) > 0)
99         <div class="mb-xl">
100             <h5>{{ trans('entities.recent_activity') }}</h5>
101             @include('common.activity-list', ['activity' => $activity])
102         </div>
103     @endif
104 @stop
105
106 @section('right')
107     <div class="actions mb-xl">
108         <h5>{{ trans('common.actions') }}</h5>
109         <div class="icon-list text-primary">
110
111             @if(userCan('book-create-all') && userCan('bookshelf-update', $shelf))
112                 <a href="{{ $shelf->getUrl('/create-book') }}" class="icon-list-item">
113                     <span class="icon">@icon('add')</span>
114                     <span>{{ trans('entities.books_new_action') }}</span>
115                 </a>
116             @endif
117
118             @include('entities.view-toggle', ['view' => $view, 'type' => 'shelf'])
119
120             <hr class="primary-background">
121
122             @if(userCan('bookshelf-update', $shelf))
123                 <a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item">
124                     <span>@icon('edit')</span>
125                     <span>{{ trans('common.edit') }}</span>
126                 </a>
127             @endif
128
129             @if(userCan('restrictions-manage', $shelf))
130                 <a href="{{ $shelf->getUrl('/permissions') }}" class="icon-list-item">
131                     <span>@icon('lock')</span>
132                     <span>{{ trans('entities.permissions') }}</span>
133                 </a>
134             @endif
135
136             @if(userCan('bookshelf-delete', $shelf))
137                 <a href="{{ $shelf->getUrl('/delete') }}" class="icon-list-item">
138                     <span>@icon('delete')</span>
139                     <span>{{ trans('common.delete') }}</span>
140                 </a>
141             @endif
142
143             @if(signedInUser())
144                 <hr class="primary-background">
145                 @include('entities.favourite-action', ['entity' => $shelf])
146             @endif
147
148         </div>
149     </div>
150 @stop
151
152
153
154