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