]> BookStack Code Mirror - bookstack/blob - resources/views/form/entity-permissions.blade.php
Hide permissions table unless custom permissions are enabled
[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     <p class="mb-none">{{ trans('entities.permissions_intro') }}</p>
6
7     <div class="form-group">
8         @include('form.checkbox', [
9             'name' => 'restricted',
10             'label' => trans('entities.permissions_enable'),
11         ])
12     </div>
13
14     <table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">
15         <tr>
16             <th>{{ trans('common.role') }}</th>
17             <th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>
18                 {{ trans('common.actions') }}
19                 <a href="#" permissions-table-toggle-all class="text-small ml-m text-primary">{{ trans('common.toggle_all') }}</a>
20             </th>
21         </tr>
22         @foreach($roles as $role)
23             <tr>
24                 <td width="33%" class="pt-m">
25                     {{ $role->display_name }}
26                     <a href="#" permissions-table-toggle-all-in-row class="text-small float right ml-m text-primary">{{ trans('common.toggle_all') }}</a>
27                 </td>
28                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
29                 @if(!$model->isA('page'))
30                     <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
31                 @endif
32                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
33                 <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
34             </tr>
35         @endforeach
36     </table>
37
38     <div class="text-right">
39         <a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
40         <button type="submit" class="button primary">{{ trans('entities.permissions_save') }}</button>
41     </div>
42 </form>