NOW MANAGED ON CODEBERG
Started item permission design revamp
Dan Brownf19bad89033e
diff --git a/resources/icons/role.svg b/resources/icons/role.svgnew file mode 100644index 000000000..e7cad506d--- /dev/null+++ b/resources/icons/role.svg@@ -0,0 +1,4 @@+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <path d="M0 0h24v24H0z" fill="none"/>+ <path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/>+</svg>\ No newline at end of filediff --git a/resources/sass/_components.scss b/resources/sass/_components.scssindex c00f57954..9f737f3be 100644--- a/resources/sass/_components.scss+++ b/resources/sass/_components.scss@@ -798,11 +798,34 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {max-width: 500px;}-.permissions-table [permissions-table-toggle-all-in-row] {- display: none;+.content-permissions {+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);+}+.content-permissions-row {+ border: 1.5px solid #E2E2E2;+ border-bottom-width: 0;+ label {+ padding-bottom: 0;+ }+ &:hover {+ background-color: #F2F2F2;+ }+}+.content-permissions-row:first-child {+ border-radius: 4px 4px 0 0;+}+.content-permissions-row:last-child {+ border-radius: 0 0 4px 4px;+ border-bottom-width: 1.5px;+}+.content-permissions-row-toggle-all {+ visibility: hidden;+}+.content-permissions-row:hover .content-permissions-row-toggle-all {+ visibility: visible;}-.permissions-table tr:hover [permissions-table-toggle-all-in-row] {- display: inline;+.content-permissions-row-label {+ font-weight: bold;}.template-item {diff --git a/resources/sass/_layout.scss b/resources/sass/_layout.scssindex 2cd57d496..cfb8397c9 100644--- a/resources/sass/_layout.scss+++ b/resources/sass/_layout.scss@@ -158,8 +158,8 @@ body.flexbox {}}-.gap-m {- gap: $-m;+.flex-none {+ flex: none;}.justify-flex-start {diff --git a/resources/sass/_spacing.scss b/resources/sass/_spacing.scssindex 40217de9b..14f8918dc 100644--- a/resources/sass/_spacing.scss+++ b/resources/sass/_spacing.scss@@ -29,4 +29,16 @@}}@include spacing('margin', 'm');-@include spacing('padding', 'p');\ No newline at end of file+@include spacing('padding', 'p');++@each $sizeLetter, $size in $spacing {+ .gap-#{$sizeLetter} {+ gap: $size !important;+ }+ .gap-x-#{$sizeLetter} {+ column-gap: $size !important;+ }+ .gap-y-#{$sizeLetter} {+ row-gap: $size !important;+ }+}diff --git a/resources/views/form/entity-permissions-row.blade.php b/resources/views/form/entity-permissions-row.blade.phpnew file mode 100644index 000000000..023aa36d2--- /dev/null+++ b/resources/views/form/entity-permissions-row.blade.php@@ -0,0 +1,28 @@+<div class="content-permissions-row flex-container-row justify-space-between wrap">+ <div class="content-permissions-row-label gap-x-m flex-container-row items-center px-l py-m flex">+ <div class="text-large" title="{{ trans('common.role') }}">+ @icon('role')+ </div>+ <span>{{ $role->display_name }}</span>+ <button type="button"+ class="ml-auto flex-none text-small text-primary text-button hover-underline content-permissions-row-toggle-all hide-under-s"+ permissions-table-toggle-all-in-row+ >{{ trans('common.toggle_all') }}</button>+ </div>+ <div class="flex-container-row justify-space-between gap-x-xl wrap items-center">+ <div class="px-l">+ @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])+ </div>+ <div class="px-l">+ @if(!$model->isA('page'))+ @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])+ @endif+ </div>+ <div class="px-l">+ @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])+ </div>+ <div class="px-l">+ @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])+ </div>+ </div>+</div>\ No newline at end of filediff --git a/resources/views/form/entity-permissions.blade.php b/resources/views/form/entity-permissions.blade.phpindex 206955fe9..18df0bb69 100644--- a/resources/views/form/entity-permissions.blade.php+++ b/resources/views/form/entity-permissions.blade.php@@ -24,31 +24,12 @@<p class="text-warn">{{ trans('entities.shelves_permissions_cascade_warning') }}</p>@endif- <hr>- <table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">- <tr>- <th>{{ trans('common.role') }}</th>- <th colspan="{{ $model->isA('page') ? '3' : '4' }}">- {{ trans('common.actions') }}- <a href="#" permissions-table-toggle-all class="text-small ml-m text-primary">{{ trans('common.toggle_all') }}</a>- </th>- </tr>+ <div class="content-permissions mt-m mb-xl">@foreach(\BookStack\Auth\Role::restrictable() as $role)- <tr>- <td width="33%" class="pt-m">- {{ $role->display_name }}- <a href="#" permissions-table-toggle-all-in-row class="text-small float right ml-m text-primary">{{ trans('common.toggle_all') }}</a>- </td>- <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>- @if(!$model->isA('page'))- <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>- @endif- <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>- <td>@include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>- </tr>+ @include('form.entity-permissions-row', ['role' => $role, 'model' => $model])@endforeach- </table>+ </div><div class="text-right"><a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>