BookStack/resources/views/settings/roles/form.blade.php

156 lines
9.8 KiB
PHP
Raw Normal View History

{!! csrf_field() !!}
<div class="row">
2016-04-09 20:52:44 +08:00
<div class="col-md-9">
<div class="row">
2016-04-09 20:52:44 +08:00
<div class="col-md-5">
2016-12-04 22:08:04 +08:00
<h3>{{ trans('settings.role_details') }}</h3>
2016-04-09 20:52:44 +08:00
<div class="form-group">
2016-12-04 22:08:04 +08:00
<label for="name">{{ trans('settings.role_name') }}</label>
2016-04-09 20:52:44 +08:00
@include('form/text', ['name' => 'display_name'])
</div>
<div class="form-group">
2016-12-04 22:08:04 +08:00
<label for="name">{{ trans('settings.role_desc') }}</label>
2016-04-09 20:52:44 +08:00
@include('form/text', ['name' => 'description'])
</div>
2016-12-04 22:08:04 +08:00
<h3>{{ trans('settings.role_system') }}</h3>
<label>@include('settings/roles/checkbox', ['permission' => 'users-manage']) {{ trans('settings.role_manage_users') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'user-roles-manage']) {{ trans('settings.role_manage_roles') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'restrictions-manage-all']) {{ trans('settings.role_manage_entity_permissions') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'permissions']) {{ trans('settings.role_manage_own_entity_permissions') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'settings-manage']) {{ trans('settings.role_manage_settings') }}</label>
</div>
2016-04-09 20:52:44 +08:00
<div class="col-md-6">
2016-04-09 20:52:44 +08:00
2016-12-04 22:08:04 +08:00
<h3>{{ trans('settings.role_asset') }}</h3>
<p>{{ trans('settings.role_asset_desc') }}</p>
2016-04-09 20:52:44 +08:00
<table class="table">
<tr>
<th width="20%"></th>
2016-12-04 22:08:04 +08:00
<th width="20%">{{ trans('common.create') }}</th>
<th width="20%">{{ trans('common.view') }}</th>
<th width="20%">{{ trans('common.edit') }}</th>
<th width="20%">{{ trans('common.delete') }}</th>
2016-04-09 20:52:44 +08:00
</tr>
<tr>
2016-12-04 22:08:04 +08:00
<td>{{ trans('entities.books') }}</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'book-create-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'book-view-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'book-view-all']) {{ trans('settings.role_all') }}</label>
</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'book-update-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'book-update-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'book-delete-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'book-delete-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
</tr>
<tr>
2016-12-04 22:08:04 +08:00
<td>{{ trans('entities.chapters') }}</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-create-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-create-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-view-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-view-all']) {{ trans('settings.role_all') }}</label>
</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-update-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-update-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-delete-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'chapter-delete-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
</tr>
<tr>
2016-12-04 22:08:04 +08:00
<td>{{ trans('entities.pages') }}</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'page-create-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'page-create-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'page-view-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'page-view-all']) {{ trans('settings.role_all') }}</label>
</td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'page-update-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'page-update-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'page-delete-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'page-delete-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
</tr>
<tr>
2016-12-04 22:08:04 +08:00
<td>{{ trans('entities.images') }}</td>
2016-04-09 20:52:44 +08:00
<td>@include('settings/roles/checkbox', ['permission' => 'image-create-all'])</td>
2016-12-04 22:08:04 +08:00
<td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
2016-04-09 20:52:44 +08:00
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'image-update-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'image-update-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'image-delete-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'image-delete-all']) {{ trans('settings.role_all') }}</label>
2016-04-09 20:52:44 +08:00
</td>
</tr>
<tr>
2016-12-04 22:08:04 +08:00
<td>{{ trans('entities.attachments') }}</td>
2016-11-12 22:12:26 +08:00
<td>@include('settings/roles/checkbox', ['permission' => 'attachment-create-all'])</td>
2016-12-04 22:08:04 +08:00
<td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'attachment-update-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'attachment-update-all']) {{ trans('settings.role_all') }}</label>
</td>
<td>
2016-12-04 22:08:04 +08:00
<label>@include('settings/roles/checkbox', ['permission' => 'attachment-delete-own']) {{ trans('settings.role_own') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'attachment-delete-all']) {{ trans('settings.role_all') }}</label>
</td>
</tr>
2016-04-09 20:52:44 +08:00
</table>
</div>
</div>
2016-12-04 22:08:04 +08:00
<a href="{{ baseUrl("/settings/roles") }}" class="button muted">{{ trans('common.cancel') }}</a>
<button type="submit" class="button pos">{{ trans('settings.role_save') }}</button>
</div>
2016-04-09 20:52:44 +08:00
<div class="col-md-3">
2016-12-04 22:08:04 +08:00
<h3>{{ trans('settings.role_users') }}</h3>
2016-04-09 20:52:44 +08:00
@if(isset($role) && count($role->users) > 0)
<table class="list-table">
@foreach($role->users as $user)
<tr>
<td style="line-height: 0;"><img class="avatar small" src="{{ $user->getAvatar(40) }}" alt="{{ $user->name }}"></td>
2016-04-09 20:52:44 +08:00
<td>
@if(userCan('users-manage') || $currentUser->id == $user->id)
<a href="{{ baseUrl("/settings/users/{$user->id}") }}">
2016-04-09 20:52:44 +08:00
@endif
{{ $user->name }}
@if(userCan('users-manage') || $currentUser->id == $user->id)
</a>
@endif
</td>
</tr>
@endforeach
</table>
2016-04-09 20:52:44 +08:00
@else
<p class="text-muted">
2016-12-04 22:08:04 +08:00
{{ trans('settings.role_users_none') }}
2016-04-09 20:52:44 +08:00
</p>
@endif
</div>
2016-04-09 20:52:44 +08:00
</div>