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