Extracted entity perms. text to translation files

This commit is contained in:
Dan Brown 2022-10-11 15:52:56 +01:00
parent 25708542ff
commit 98c6422fa6
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
5 changed files with 20 additions and 18 deletions

View File

@ -61,8 +61,8 @@ class PermissionFormData
{
return (new Role())->forceFill([
'id' => 0,
'display_name' => 'Everyone Else',
'description' => 'Set permissions for all roles not specifically overridden.'
'display_name' => trans('entities.permissions_role_everyone_else'),
'description' => trans('entities.permissions_role_everyone_else_desc'),
]);
}
}

View File

@ -29,6 +29,7 @@ class PermissionsController extends Controller
$page = Page::getBySlugs($bookSlug, $pageSlug);
$this->checkOwnablePermission('restrictions-manage', $page);
$this->setPageTitle(trans('entities.pages_permissions'));
return view('pages.permissions', [
'page' => $page,
'data' => new PermissionFormData($page),
@ -58,6 +59,7 @@ class PermissionsController extends Controller
$chapter = Chapter::getBySlugs($bookSlug, $chapterSlug);
$this->checkOwnablePermission('restrictions-manage', $chapter);
$this->setPageTitle(trans('entities.chapters_permissions'));
return view('chapters.permissions', [
'chapter' => $chapter,
'data' => new PermissionFormData($chapter),
@ -87,6 +89,7 @@ class PermissionsController extends Controller
$book = Book::getBySlug($slug);
$this->checkOwnablePermission('restrictions-manage', $book);
$this->setPageTitle(trans('entities.books_permissions'));
return view('books.permissions', [
'book' => $book,
'data' => new PermissionFormData($book),
@ -116,6 +119,7 @@ class PermissionsController extends Controller
$shelf = Bookshelf::getBySlug($slug);
$this->checkOwnablePermission('restrictions-manage', $shelf);
$this->setPageTitle(trans('entities.shelves_permissions'));
return view('shelves.permissions', [
'shelf' => $shelf,
'data' => new PermissionFormData($shelf),

View File

@ -42,9 +42,14 @@ return [
// Permissions and restrictions
'permissions' => 'Permissions',
'permissions_intro' => 'Once enabled, These permissions will take priority over any set role permissions.',
'permissions_desc' => 'Set permissions here to override the default permissions provided by user roles.',
'permissions_book_cascade' => 'Permissions set on books will automatically cascade to child chapters and pages, unless they have their own permissions defined.',
'permissions_chapter_cascade' => 'Permissions set on chapters will automatically cascade to child pages, unless they have their own permissions defined.',
'permissions_save' => 'Save Permissions',
'permissions_owner' => 'Owner',
'permissions_role_everyone_else' => 'Everyone Else',
'permissions_role_everyone_else_desc' => 'Set permissions for all roles not specifically overridden.',
'permissions_role_override' => 'Override permissions for role',
// Search
'search_results' => 'Search Results',

View File

@ -7,7 +7,7 @@ $inheriting - Boolean if the current row should be marked as inheriting default
<div component="permissions-table" class="content-permissions-row flex-container-row justify-space-between wrap">
<div class="gap-x-m flex-container-row items-center px-l py-m flex">
<div class="text-large" title="{{ $role->id === 0 ? 'Everyone Else' : trans('common.role') }}">
<div class="text-large" title="{{ $role->id === 0 ? trans('entities.permissions_role_everyone_else') : trans('common.role') }}">
@icon($role->id === 0 ? 'groups' : 'role')
</div>
<span>
@ -80,8 +80,8 @@ $inheriting - Boolean if the current row should be marked as inheriting default
class="text-neg p-m icon-button"
data-role-id="{{ $role->id }}"
data-role-name="{{ $role->display_name }}"
title="Remove Row">
@icon('close') <span class="hide-over-m ml-xs">Remove Row</span>
title="{{ trans('common.remove') }}">
@icon('close') <span class="hide-over-m ml-xs">{{ trans('common.remove') }}</span>
</button>
</div>
@endif

View File

@ -11,20 +11,13 @@
<div class="grid half left-focus v-end gap-m wrap">
<div>
<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.
{{ trans('entities.permissions_desc') }}
@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.
<br> {{ trans('entities.permissions_book_cascade') }}
@elseif($model instanceof \BookStack\Entities\Models\Chapter)
<br> {{ trans('entities.permissions_chapter_cascade') }}
@endif
</p>
@ -55,7 +48,7 @@
<div class="flex-container-row justify-flex-end mb-xl">
<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>
<label for="role_select" class="m-none p-none"><span class="bold">{{ trans('entities.permissions_role_override') }}</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)