@section('title', __('general.page_permissions_title', ['name' => $adminData->nickname ?? ''])) @section('head') @endsection @php $breadcrumb = [ ['label' => __('general.top_menu_item_general')], ['label' => __('general.page_users_h1'), 'url' => route('users.r')], ['label' => __('general.page_permissions_breadcrumb')], ]; $locked = 'dashboard'; $total = 0; $on = 0; $tally = []; foreach ($groups as $groupKey => $group) { $tally[$groupKey] = ['on' => 0, 'total' => 0, 'free' => 0, 'sections' => []]; foreach ($group['sections'] as $sectionKey => $section) { $sectionOn = 0; foreach (array_keys($section['items']) as $item) { $name = permission_name($groups, $groupKey, $item); if ($name !== $locked) { $tally[$groupKey]['free']++; } if ($name === $locked || isset($granted[$name])) { $sectionOn++; } } $tally[$groupKey]['sections'][$sectionKey] = ['on' => $sectionOn, 'total' => count($section['items'])]; $tally[$groupKey]['on'] += $sectionOn; $tally[$groupKey]['total'] += count($section['items']); } $on += $tally[$groupKey]['on']; $total += $tally[$groupKey]['total']; } @endphp @include('includes/header-novo')
@include('includes.breadcrumb') @include('includes.flash')

{{ $adminData->nickname ?? __('general.page_permissions_breadcrumb') }}

{{ __('general.perm_intro') }}

{{ $on }} {{ trans_choice('general.perm_of_total', $total, ['total' => $total]) }}
@foreach($groups as $groupKey => $group) @php $groupTally = $tally[$groupKey]; @endphp

{{ $group['label'] }}

{{ trans_choice('general.perm_group_count', $groupTally['on'], ['total' => $groupTally['total']]) }}

@if($groupTally['free'] > 1) @endif
@foreach($group['sections'] as $sectionKey => $section) @php $sectionTally = $groupTally['sections'][$sectionKey]; @endphp
@if(count($group['sections']) > 1)

{{ $section['label'] }} {{ __('general.perm_section_count', ['count' => $sectionTally['on'], 'total' => $sectionTally['total']]) }}

@endif
@foreach($section['items'] as $item => $data) @php $name = permission_name($groups, $groupKey, $item); @endphp @if($name === $locked)
{{ $data['label'] }} {{ __('general.perm_always') }}
@else @endif @endforeach
@endforeach
@endforeach
{{ __('site.btn_cancel') }}
@section('scripts') @endsection @include('includes/footer-novo')