]> BookStack Code Mirror - bookstack/blob - resources/views/form/entity-permissions.blade.php
[Fix] app_footer_links_desc
[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('components.user-select', ['user' => $model->ownedBy, 'name' => 'owned_by', 'compact' => false])
19             </div>
20         </div>
21     </div>
22
23     <hr>
24
25     <table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">
26         <tr>
27             <th>{{ trans('common.role') }}</th>
28             <th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>
29                 {{ trans('common.actions') }}
30                 <a href="#" permissions-table-toggle-all class="text-small ml-m text-primary">{{ trans('common.toggle_all') }}</a>
31             </th>
32         </tr>
33         @foreach(\BookStack\Auth\Role::restrictable() as $role)
34             <tr>
35                 <td width="33%" class="pt-m">
36                     {{ $role->display_name }}
37                     <a href="#" permissions-table-toggle-all-in-row class="text-small float right ml-m text-primary">{{ trans('common.toggle_all') }}</a>
38                 </td>
39                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
40                 @if(!$model->isA('page'))
41                     <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
42                 @endif
43                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
44                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
45             </tr>
46         @endforeach
47     </table>
48
49     <div class="text-right">
50         <a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
51         <button type="submit" class="button">{{ trans('entities.permissions_save') }}</button>
52     </div>
53 </form>