Refined design and text for entity permission changes

This commit is contained in:
Dan Brown 2022-10-11 15:41:21 +01:00
parent 0fae807713
commit 25708542ff
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
8 changed files with 51 additions and 31 deletions

View File

@ -880,7 +880,8 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
gap: $-s;
line-height: normal;
.svg-icon {
height: 16px;
height: 26px;
width: 26px;
margin: 0;
}
.avatar {
@ -902,10 +903,11 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
white-space: nowrap;
}
.dropdown-search-toggle-select-caret {
font-size: 1.5rem;
line-height: 0;
margin-left: auto;
margin-top: -2px;
display: flex;
align-items: center;
}
.dropdown-search-dropdown {

View File

@ -207,8 +207,8 @@ select {
-moz-appearance: none;
appearance: none;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23666666'><polygon points='0,0 100,0 50,50'/></svg>");
background-size: 12px;
background-position: calc(100% - 20px) 70%;
background-size: 10px 12px;
background-position: calc(100% - 20px) 64%;
background-repeat: no-repeat;
@include rtl {

View File

@ -14,9 +14,8 @@
]])
</div>
<main class="card content-wrap">
<h1 class="list-heading">{{ trans('entities.books_permissions') }}</h1>
@include('form.entity-permissions', ['model' => $book])
<main class="card content-wrap auto-height">
@include('form.entity-permissions', ['model' => $book, 'title' => trans('entities.books_permissions')])
</main>
</div>

View File

@ -15,9 +15,8 @@
]])
</div>
<main class="card content-wrap">
<h1 class="list-heading">{{ trans('entities.chapters_permissions') }}</h1>
@include('form.entity-permissions', ['model' => $chapter])
<main class="card content-wrap auto-height">
@include('form.entity-permissions', ['model' => $chapter, 'title' => trans('entities.chapters_permissions')])
</main>
</div>

View File

@ -8,21 +8,39 @@
{!! csrf_field() !!}
<input type="hidden" name="_method" value="PUT">
<div class="grid half left-focus v-center">
<div class="grid half left-focus v-end gap-m wrap">
<div>
<p class="mb-none mt-m">{{ trans('entities.permissions_intro') }}</p>
<h1 class="list-heading">{{ $title }}</h1>
{{-- <p class="mb-none mt-m">{{ trans('entities.permissions_intro') }}</p>--}}
<p class="text-muted mb-s">
Set permissions here to override the default permissions provided by user roles.
@if($model instanceof \BookStack\Entities\Models\Book)
<br>
Permissions set on books will automatically cascade to child chapters and pages, unless
they have their own permissions defined.
@endif
@if($model instanceof \BookStack\Entities\Models\Chapter)
<br>
Permissions set on chapters will automatically cascade to child pages, unless
they have their own permissions defined.
@endif
</p>
@if($model instanceof \BookStack\Entities\Models\Bookshelf)
<p class="text-warn">{{ trans('entities.shelves_permissions_cascade_warning') }}</p>
@endif
</div>
<div>
<div class="form-group">
<div class="flex-container-row justify-flex-end">
<div class="form-group mb-m">
<label for="owner">{{ trans('entities.permissions_owner') }}</label>
@include('form.user-select', ['user' => $model->ownedBy, 'name' => 'owned_by'])
</div>
</div>
</div>
@if($model instanceof \BookStack\Entities\Models\Bookshelf)
<p class="text-warn">{{ trans('entities.shelves_permissions_cascade_warning') }}</p>
@endif
<hr>
<div refs="entity-permissions@role-container" class="content-permissions mt-m mb-m">
@foreach($data->permissionsWithRoles() as $permission)
@ -36,8 +54,8 @@
</div>
<div class="flex-container-row justify-flex-end mb-xl">
<div>
<label for="role_select">Override permissions for role</label>
<div class="flex-container-row items-center gap-m">
<label for="role_select" class="m-none p-none"><span class="bold">Override permissions for role</span></label>
<select name="role_select" id="role_select" refs="entity-permissions@role-select">
<option value="">{{ trans('common.select') }}</option>
@foreach($data->rolesNotAssigned() as $role)
@ -56,6 +74,8 @@
])
</div>
<hr class="mb-m">
<div class="text-right">
<a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
<button type="submit" class="button">{{ trans('entities.permissions_save') }}</button>

View File

@ -16,9 +16,8 @@
]])
</div>
<main class="card content-wrap">
<h1 class="list-heading">{{ trans('entities.pages_permissions') }}</h1>
@include('form.entity-permissions', ['model' => $page])
<main class="card content-wrap auto-height">
@include('form.entity-permissions', ['model' => $page, 'title' => trans('entities.pages_permissions')])
</main>
</div>

View File

@ -2,7 +2,7 @@
@section('body')
<div class="container small">
<div class="container">
<div class="my-s">
@include('entities.breadcrumbs', ['crumbs' => [
@ -15,14 +15,15 @@
</div>
<div class="card content-wrap auto-height">
<h1 class="list-heading">{{ trans('entities.shelves_permissions') }}</h1>
@include('form.entity-permissions', ['model' => $shelf])
@include('form.entity-permissions', ['model' => $shelf, 'title' => trans('entities.shelves_permissions')])
</div>
<div class="card content-wrap auto-height">
<div class="card content-wrap auto-height flex-container-row items-center gap-x-xl wrap">
<div class="flex">
<h2 class="list-heading">{{ trans('entities.shelves_copy_permissions_to_books') }}</h2>
<p>{{ trans('entities.shelves_copy_permissions_explain') }}</p>
<form action="{{ $shelf->getUrl('/copy-permissions') }}" method="post" class="text-right">
</div>
<form action="{{ $shelf->getUrl('/copy-permissions') }}" method="post" class="flex text-right">
{{ csrf_field() }}
<button class="button">{{ trans('entities.shelves_copy_permissions') }}</button>
</form>

View File

@ -139,12 +139,12 @@ Route::middleware('auth')->group(function () {
Route::post('/books/{bookSlug}/chapter/{chapterSlug}/copy', [ChapterController::class, 'copy']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/edit', [ChapterController::class, 'edit']);
Route::post('/books/{bookSlug}/chapter/{chapterSlug}/convert-to-book', [ChapterController::class, 'convertToBook']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'showForPage']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'showForChapter']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/pdf', [ChapterExportController::class, 'pdf']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/html', [ChapterExportController::class, 'html']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/markdown', [ChapterExportController::class, 'markdown']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/plaintext', [ChapterExportController::class, 'plainText']);
Route::put('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'updateForPage']);
Route::put('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'updateForChapter']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/references', [ReferenceController::class, 'chapter']);
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/delete', [ChapterController::class, 'showDelete']);
Route::delete('/books/{bookSlug}/chapter/{chapterSlug}', [ChapterController::class, 'destroy']);