NOW MANAGED ON CODEBERG
Refined design and text for entity permission changes
Dan Brown25708542ff0e
diff --git a/resources/sass/_components.scss b/resources/sass/_components.scssindex 42477982a..2aba3bd74 100644--- a/resources/sass/_components.scss+++ b/resources/sass/_components.scss@@ -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 {diff --git a/resources/sass/_forms.scss b/resources/sass/_forms.scssindex 5c1c8b2e8..7e0f72355 100644--- a/resources/sass/_forms.scss+++ b/resources/sass/_forms.scss@@ -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 {diff --git a/resources/views/books/permissions.blade.php b/resources/views/books/permissions.blade.phpindex d72042d42..2e43338cd 100644--- a/resources/views/books/permissions.blade.php+++ b/resources/views/books/permissions.blade.php@@ -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>diff --git a/resources/views/chapters/permissions.blade.php b/resources/views/chapters/permissions.blade.phpindex 6b4e21938..acdaf0ab9 100644--- a/resources/views/chapters/permissions.blade.php+++ b/resources/views/chapters/permissions.blade.php@@ -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>diff --git a/resources/views/form/entity-permissions.blade.php b/resources/views/form/entity-permissions.blade.phpindex a6955d33c..5e6503e0e 100644--- a/resources/views/form/entity-permissions.blade.php+++ b/resources/views/form/entity-permissions.blade.php@@ -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>diff --git a/resources/views/pages/permissions.blade.php b/resources/views/pages/permissions.blade.phpindex 792015e28..93e14ee0d 100644--- a/resources/views/pages/permissions.blade.php+++ b/resources/views/pages/permissions.blade.php@@ -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>diff --git a/resources/views/shelves/permissions.blade.php b/resources/views/shelves/permissions.blade.phpindex a26325518..e79b34096 100644--- a/resources/views/shelves/permissions.blade.php+++ b/resources/views/shelves/permissions.blade.php@@ -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">- <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 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>+ </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>diff --git a/routes/web.php b/routes/web.phpindex 5fdfda3f0..1cffbfd7d 100644--- a/routes/web.php+++ b/routes/web.php@@ -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']);