1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Revised role index list to align with user list

This commit is contained in:
Dan Brown
2022-10-29 20:52:17 +01:00
parent 0ef06fd298
commit 98b59a1024
8 changed files with 109 additions and 43 deletions

View File

@@ -12,30 +12,38 @@
<h1 class="list-heading">{{ trans('settings.role_user_roles') }}</h1>
<div class="text-right">
<a href="{{ url("/settings/roles/new") }}" class="button outline">{{ trans('settings.role_create') }}</a>
<a href="{{ url("/settings/roles/new") }}" class="button outline my-none">{{ trans('settings.role_create') }}</a>
</div>
</div>
<table class="table">
<tr>
<th>{{ trans('settings.role_name') }}</th>
<th></th>
<th class="text-center">{{ trans('settings.users') }}</th>
</tr>
@foreach($roles as $role)
<tr>
<td><a href="{{ url("/settings/roles/{$role->id}") }}">{{ $role->display_name }}</a></td>
<td>
@if($role->mfa_enforced)
<span title="{{ trans('settings.role_mfa_enforced') }}">@icon('lock') </span>
@endif
{{ $role->description }}
</td>
<td class="text-center">{{ $role->users->count() }}</td>
</tr>
@endforeach
</table>
<p class="text-muted">{{ trans('settings.roles_index_desc') }}</p>
<div class="flex-container-row items-center justify-space-between gap-m mt-m mb-l wrap">
<div>
<div class="block inline mr-xs">
<form method="get" action="{{ url("/settings/roles") }}">
<input type="text" name="search" placeholder="{{ trans('common.search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
</form>
</div>
</div>
<div class="justify-flex-end">
@include('common.sort', ['options' => [
'display_name' => trans('common.sort_name'),
'users_count' => trans('settings.roles_assigned_users'),
'permissions_count' => trans('settings.roles_permissions_provided'),
], 'order' => $listDetails['order'], 'sort' => $listDetails['sort'], 'type' => 'roles'])
</div>
</div>
<div class="item-list">
@foreach($roles as $role)
@include('settings.roles.parts.roles-list-item', ['role' => $role])
@endforeach
</div>
<div class="mb-m">
{{ $roles->links() }}
</div>
</div>
</div>

View File

@@ -0,0 +1,14 @@
<div class="item-list-row flex-container-row py-xs items-center">
<div class="py-xs px-m flex-2">
<a href="{{ url("/settings/roles/{$role->id}") }}">{{ $role->display_name }}</a><br>
@if($role->mfa_enforced)
<small title="{{ trans('settings.role_mfa_enforced') }}">@icon('lock') </small>
@endif
<small>{{ $role->description }}</small>
</div>
<div class="text-right flex py-xs px-m text-muted">
{{ trans_choice('settings.roles_x_users_assigned', $role->users_count, ['count' => $role->users_count]) }}
<br>
{{ trans_choice('settings.roles_x_permissions_provided', $role->permissions_count, ['count' => $role->permissions_count]) }}
</div>
</div>