]> BookStack Code Mirror - bookstack/blob - resources/views/form/entity-permissions.blade.php
Added language list favourites sorting, updated styles
[bookstack] / resources / views / form / entity-permissions.blade.php
1 <form action="{{ $model->getUrl('/permissions') }}" method="POST" entity-permissions-editor>
2     {!! csrf_field() !!}
3     <input type="hidden" name="_method" value="PUT">
4
5     <div class="grid half left-focus v-center">
6         <div>
7             <p class="mb-none mt-m">{{ trans('entities.permissions_intro') }}</p>
8             <div>
9                 @include('form.checkbox', [
10                     'name' => 'restricted',
11                     'label' => trans('entities.permissions_enable'),
12                 ])
13             </div>
14         </div>
15         <div>
16             <div class="form-group">
17                 <label for="owner">{{ trans('entities.permissions_owner') }}</label>
18                 @include('form.user-select', ['user' => $model->ownedBy, 'name' => 'owned_by'])
19             </div>
20         </div>
21     </div>
22
23     @if($model instanceof \BookStack\Entities\Models\Bookshelf)
24         <p class="text-warn">{{ trans('entities.shelves_permissions_cascade_warning') }}</p>
25     @endif
26
27     <hr>
28
29     <table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">
30         <tr>
31             <th>{{ trans('common.role') }}</th>
32             <th colspan="{{ $model->isA('page') ? '3' : '4'  }}">
33                 {{ trans('common.actions') }}
34                 <a href="#" permissions-table-toggle-all class="text-small ml-m text-primary">{{ trans('common.toggle_all') }}</a>
35             </th>
36         </tr>
37         @foreach(\BookStack\Auth\Role::restrictable() as $role)
38             <tr>
39                 <td width="33%" class="pt-m">
40                     {{ $role->display_name }}
41                     <a href="#" permissions-table-toggle-all-in-row class="text-small float right ml-m text-primary">{{ trans('common.toggle_all') }}</a>
42                 </td>
43                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
44                 @if(!$model->isA('page'))
45                     <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
46                 @endif
47                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
48                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
49             </tr>
50         @endforeach
51     </table>
52
53     <div class="text-right">
54         <a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
55         <button type="submit" class="button">{{ trans('entities.permissions_save') }}</button>
56     </div>
57 </form>