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