]> BookStack Code Mirror - bookstack/blob - resources/views/shelves/show.blade.php
respective book and chapter structure added.
[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 print-hidden">
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', $listOptions->getSortControlData())
27             </div>
28         </div>
29
30         <div class="book-content">
31             <div class="text-muted break-text">{!! $shelf->descriptionHtml() !!}</div>
32             @if(count($sortedVisibleShelfBooks) > 0)
33                 @if($view === 'list')
34                     <div class="entity-list">
35                         @foreach($sortedVisibleShelfBooks as $book)
36                             @include('books.parts.list-item', ['book' => $book])
37                         @endforeach
38                     </div>
39                 @else
40                     <div class="grid third">
41                         @foreach($sortedVisibleShelfBooks as $book)
42                             @include('entities.grid-item', ['entity' => $book])
43                         @endforeach
44                     </div>
45                 @endif
46             @else
47                 <div class="mt-xl">
48                     <hr>
49                     <p class="text-muted italic mt-xl mb-m">{{ trans('entities.shelves_empty_contents') }}</p>
50                     <div class="icon-list inline block">
51                         @if(userCan('book-create-all') && userCan('bookshelf-update', $shelf))
52                             <a href="{{ $shelf->getUrl('/create-book') }}" class="icon-list-item text-book">
53                                 <span class="icon">@icon('add')</span>
54                                 <span>{{ trans('entities.books_create') }}</span>
55                             </a>
56                         @endif
57                         @if(userCan('bookshelf-update', $shelf))
58                             <a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item text-bookshelf">
59                                 <span class="icon">@icon('edit')</span>
60                                 <span>{{ trans('entities.shelves_edit_and_assign') }}</span>
61                             </a>
62                         @endif
63                     </div>
64                 </div>
65             @endif
66         </div>
67     </main>
68
69 @stop
70
71 @section('left')
72
73     @if($shelf->tags->count() > 0)
74         <div id="tags" class="mb-xl">
75             @include('entities.tag-list', ['entity' => $shelf])
76         </div>
77     @endif
78
79     <div id="details" class="mb-xl">
80         <h5>{{ trans('common.details') }}</h5>
81         <div class="blended-links">
82             @include('entities.meta', ['entity' => $shelf, 'watchOptions' => null])
83             @if($shelf->hasPermissions())
84                 <div class="active-restriction">
85                     @if(userCan('restrictions-manage', $shelf))
86                         <a href="{{ $shelf->getUrl('/permissions') }}" class="entity-meta-item">
87                             @icon('lock')
88                             <div>{{ trans('entities.shelves_permissions_active') }}</div>
89                         </a>
90                     @else
91                         <div class="entity-meta-item">
92                             @icon('lock')
93                             <div>{{ trans('entities.shelves_permissions_active') }}</div>
94                         </div>
95                     @endif
96                 </div>
97             @endif
98         </div>
99     </div>
100
101     @if(count($activity) > 0)
102         <div id="recent-activity" class="mb-xl">
103             <h5>{{ trans('entities.recent_activity') }}</h5>
104             @include('common.activity-list', ['activity' => $activity])
105         </div>
106     @endif
107 @stop
108
109 @section('right')
110     <div class="actions mb-xl">
111         <h5>{{ trans('common.actions') }}</h5>
112         <div class="icon-list text-link">
113
114             @if(userCan('book-create-all') && userCan('bookshelf-update', $shelf))
115                 <a href="{{ $shelf->getUrl('/create-book') }}" data-shortcut="new" class="icon-list-item">
116                     <span class="icon">@icon('add')</span>
117                     <span>{{ trans('entities.books_new_action') }}</span>
118                 </a>
119             @endif
120
121             @include('entities.view-toggle', ['view' => $view, 'type' => 'bookshelf'])
122
123             <hr class="primary-background">
124
125             @if(userCan('bookshelf-update', $shelf))
126                 <a href="{{ $shelf->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
127                     <span>@icon('edit')</span>
128                     <span>{{ trans('common.edit') }}</span>
129                 </a>
130             @endif
131
132             @if(userCan('restrictions-manage', $shelf))
133                 <a href="{{ $shelf->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
134                     <span>@icon('lock')</span>
135                     <span>{{ trans('entities.permissions') }}</span>
136                 </a>
137             @endif
138
139             @if(userCan('bookshelf-delete', $shelf))
140                 <a href="{{ $shelf->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
141                     <span>@icon('delete')</span>
142                     <span>{{ trans('common.delete') }}</span>
143                 </a>
144             @endif
145
146             @if(!user()->isGuest())
147                 <hr class="primary-background">
148                 @include('entities.favourite-action', ['entity' => $shelf])
149             @endif
150
151         </div>
152     </div>
153 @stop
154
155
156
157