]> BookStack Code Mirror - bookstack/blob - resources/views/shelves/show.blade.php
Updated attachment links to have dropdown for open type
[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="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') }}" class="entity-meta-item">
90                             @icon('lock')
91                             <div>{{ trans('entities.shelves_permissions_active') }}</div>
92                         </a>
93                     @else
94                         <div class="entity-meta-item">
95                             @icon('lock')
96                             <div>{{ trans('entities.shelves_permissions_active') }}</div>
97                         </div>
98                     @endif
99                 </div>
100             @endif
101         </div>
102     </div>
103
104     @if(count($activity) > 0)
105         <div class="mb-xl">
106             <h5>{{ trans('entities.recent_activity') }}</h5>
107             @include('common.activity-list', ['activity' => $activity])
108         </div>
109     @endif
110 @stop
111
112 @section('right')
113     <div class="actions mb-xl">
114         <h5>{{ trans('common.actions') }}</h5>
115         <div class="icon-list text-primary">
116
117             @if(userCan('book-create-all') && userCan('bookshelf-update', $shelf))
118                 <a href="{{ $shelf->getUrl('/create-book') }}" class="icon-list-item">
119                     <span class="icon">@icon('add')</span>
120                     <span>{{ trans('entities.books_new_action') }}</span>
121                 </a>
122             @endif
123
124             @include('entities.view-toggle', ['view' => $view, 'type' => 'shelf'])
125
126             <hr class="primary-background">
127
128             @if(userCan('bookshelf-update', $shelf))
129                 <a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item">
130                     <span>@icon('edit')</span>
131                     <span>{{ trans('common.edit') }}</span>
132                 </a>
133             @endif
134
135             @if(userCan('restrictions-manage', $shelf))
136                 <a href="{{ $shelf->getUrl('/permissions') }}" class="icon-list-item">
137                     <span>@icon('lock')</span>
138                     <span>{{ trans('entities.permissions') }}</span>
139                 </a>
140             @endif
141
142             @if(userCan('bookshelf-delete', $shelf))
143                 <a href="{{ $shelf->getUrl('/delete') }}" class="icon-list-item">
144                     <span>@icon('delete')</span>
145                     <span>{{ trans('common.delete') }}</span>
146                 </a>
147             @endif
148
149             @if(signedInUser())
150                 <hr class="primary-background">
151                 @include('entities.favourite-action', ['entity' => $shelf])
152             @endif
153
154         </div>
155     </div>
156 @stop
157
158
159
160