]> BookStack Code Mirror - bookstack/blob - resources/views/settings/sort-sets/parts/form.blade.php
38db840ac57646c5783c4581bea12e96ad7834ef
[bookstack] / resources / views / settings / sort-sets / parts / form.blade.php
1 <div class="setting-list">
2     <div class="grid half">
3         <div>
4             <label class="setting-list-label">{{ trans('settings.sort_set_details') }}</label>
5             <p class="text-muted text-small">{{ trans('settings.sort_set_details_desc') }}</p>
6         </div>
7         <div>
8             <div class="form-group">
9                 <label for="name">{{ trans('common.name') }}</label>
10                 @include('form.text', ['name' => 'name'])
11             </div>
12         </div>
13     </div>
14
15     <div component="sort-set-manager">
16         <label class="setting-list-label">{{ trans('settings.sort_set_operations') }}</label>
17         <p class="text-muted text-small">{{ trans('settings.sort_set_operations_desc') }}</p>
18         @include('form.errors', ['name' => 'sequence'])
19
20         <input refs="sort-set-manager@input" type="hidden" name="sequence"
21                value="{{ old('sequence') ?? $model?->sequence ?? '' }}">
22
23         @php
24             $configuredOps = old('sequence') ? \BookStack\Sorting\SortSetOperation::fromSequence(old('sequence')) : ($model?->getOperations() ?? []);
25         @endphp
26
27         <div class="grid half">
28             <div class="form-group">
29                 <label for="books"
30                        id="sort-set-configured-operations">{{ trans('settings.sort_set_configured_operations') }}</label>
31                 <ul refs="sort-set-manager@configured-operations-list"
32                     aria-labelledby="sort-set-configured-operations"
33                     class="scroll-box configured-option-list">
34                     <li class="text-muted empty-state px-m py-s italic text-small">{{ trans('settings.sort_set_configured_operations_empty') }}</li>
35
36                     @foreach($configuredOps as $operation)
37                         @include('settings.sort-sets.parts.operation', ['operation' => $operation])
38                     @endforeach
39                 </ul>
40             </div>
41
42             <div class="form-group">
43                 <label for="books"
44                        id="sort-set-available-operations">{{ trans('settings.sort_set_available_operations') }}</label>
45                 <ul refs="sort-set-manager@available-operations-list"
46                     aria-labelledby="sort-set-available-operations"
47                     class="scroll-box available-option-list">
48                     <li class="text-muted empty-state px-m py-s italic text-small">{{ trans('settings.sort_set_available_operations_empty') }}</li>
49                     @foreach(\BookStack\Sorting\SortSetOperation::allExcluding($configuredOps) as $operation)
50                         @include('settings.sort-sets.parts.operation', ['operation' => $operation])
51                     @endforeach
52                 </ul>
53             </div>
54         </div>
55     </div>
56 </div>