]> BookStack Code Mirror - bookstack/blobdiff - resources/views/form/entity-permissions-row.blade.php
ZIP Imports: Added API examples, finished testing
[bookstack] / resources / views / form / entity-permissions-row.blade.php
index 2bf19db64c61f65474007e933406a0df219a65fa..a47027d795e42d592529979d495f674245f5f310 100644 (file)
@@ -2,11 +2,12 @@
 $role - The Role to display this row for.
 $entityType - String identifier for type of entity having permissions applied.
 $permission - The entity permission containing the permissions.
+$inheriting - Boolean if the current row should be marked as inheriting default permissions. Used for "Everyone Else" role.
 --}}
 
-<div component="permissions-table" class="content-permissions-row flex-container-row justify-space-between wrap">
+<div component="permissions-table" class="item-list-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>
@@ -15,27 +16,25 @@ $permission - The entity permission containing the permissions.
         </span>
         @if($role->id !== 0)
             <button type="button"
-                class="ml-auto flex-none text-small text-primary text-button hover-underline content-permissions-row-toggle-all hide-under-s"
+                class="ml-auto flex-none text-small text-link text-button hover-underline item-list-row-toggle-all hide-under-s"
                 refs="permissions-table@toggle-all"
                 ><strong>{{ trans('common.toggle_all') }}</strong></button>
         @endif
     </div>
-    @php
-        // TODO
-        $inheriting = ($role->id === 0);
-    @endphp
     @if($role->id === 0)
-        <div class="px-l flex-container-row items-center" refs="entity-permissions@everyoneInherit">
+        <div class="px-l flex-container-row items-center" refs="entity-permissions@everyone-inherit">
             @include('form.custom-checkbox', [
                 'name' => 'entity-permissions-inherit',
-                'label' => 'Inherit defaults',
+                'label' => trans('entities.permissions_inherit_defaults'),
                 'value' => 'true',
                 'checked' => $inheriting
             ])
         </div>
     @endif
     <div class="flex-container-row justify-space-between gap-x-xl wrap items-center">
-        <input type="hidden" name="permissions[{{ $role->id }}][active]" value="true">
+        <input type="hidden" name="permissions[{{ $role->id }}][active]"
+               @if($inheriting) disabled="disabled" @endif
+               value="true">
         <div class="px-l">
             @include('form.custom-checkbox', [
                 'name' =>  'permissions[' . $role->id . '][view]',
@@ -49,7 +48,7 @@ $permission - The entity permission containing the permissions.
             <div class="px-l">
                 @include('form.custom-checkbox', [
                     'name' =>  'permissions[' . $role->id . '][create]',
-                    'label' => trans('common.create'),
+                    'label' => trans('common.create') . ($entityType === 'bookshelf' ? ' *'  : ''),
                     'value' => 'true',
                     'checked' => $permission->create,
                     'disabled' => $inheriting
@@ -81,8 +80,8 @@ $permission - The entity permission containing the permissions.
                     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