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