]> BookStack Code Mirror - bookstack/blob - resources/views/books/sort.blade.php
3c59ac1e0928e1a2acde9e3c6afdae958d3ad119
[bookstack] / resources / views / books / sort.blade.php
1 @extends('layouts.simple')
2
3 @section('body')
4
5     <div class="container">
6
7         <div class="my-s">
8             @include('entities.breadcrumbs', ['crumbs' => [
9                 $book,
10                 $book->getUrl('/sort') => [
11                     'text' => trans('entities.books_sort'),
12                     'icon' => 'sort',
13                 ]
14             ]])
15         </div>
16
17         <div class="grid left-focus gap-xl">
18             <div>
19                 <div component="book-sort" class="card content-wrap auto-height">
20                     <h1 class="list-heading">{{ trans('entities.books_sort') }}</h1>
21
22                     <div class="flex-container-row gap-m wrap mb-m">
23                         <p class="text-muted flex min-width-s mb-none">{{ trans('entities.books_sort_desc') }}</p>
24                         <div class="min-width-s">
25                             @php
26                                 $autoSortVal = intval(old('auto-sort') ?? $book->sort_set_id ?? 0);
27                             @endphp
28                             <label for="auto-sort">{{ trans('entities.books_sort_auto_sort') }}</label>
29                             <select id="auto-sort"
30                                     name="auto-sort"
31                                     form="sort-form"
32                                     class="{{ $errors->has('auto-sort') ? 'neg' : '' }}">
33                                 <option value="0" @if($autoSortVal === 0) selected @endif>-- {{ trans('common.none') }} --</option>
34                                 @foreach(\BookStack\Sorting\SortSet::allByName() as $set)
35                                     <option value="{{$set->id}}"
36                                             @if($autoSortVal === $set->id) selected @endif
37                                     >
38                                         {{ $set->name }}
39                                     </option>
40                                 @endforeach
41                             </select>
42                         </div>
43                     </div>
44
45                     <div refs="book-sort@sortContainer">
46                         @include('books.parts.sort-box', ['book' => $book, 'bookChildren' => $bookChildren])
47                     </div>
48
49                     <form id="sort-form" action="{{ $book->getUrl('/sort') }}" method="POST">
50                         {{ csrf_field() }}
51                         <input type="hidden" name="_method" value="PUT">
52                         <input refs="book-sort@input" type="hidden" name="sort-tree">
53                         <div class="list text-right">
54                             <a href="{{ $book->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
55                             <button class="button" type="submit">{{ trans('entities.books_sort_save') }}</button>
56                         </div>
57                     </form>
58                 </div>
59             </div>
60
61             <div>
62                 <main class="card content-wrap auto-height sticky-top-m">
63                     <h2 class="list-heading">{{ trans('entities.books_sort_show_other') }}</h2>
64                     <p class="text-muted">{{ trans('entities.books_sort_show_other_desc') }}</p>
65
66                     @include('entities.selector', ['name' => 'books_list', 'selectorSize' => 'compact', 'entityTypes' => 'book', 'entityPermission' => 'update'])
67
68                 </main>
69             </div>
70         </div>
71
72     </div>
73
74 @stop