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