phases one of time logged now with log display
This commit is contained in:
@@ -12,17 +12,21 @@
|
||||
$items = $this->getUserMenuItems();
|
||||
|
||||
$itemsBeforeAndAfterThemeSwitcher = collect($items)
|
||||
->groupBy(fn (Action $item): bool => $item->getSort() < 0, preserveKeys: true)
|
||||
->groupBy(fn(Action $item): bool => $item->getSort() < 0, preserveKeys: true)
|
||||
->all();
|
||||
$itemsBeforeThemeSwitcher = $itemsBeforeAndAfterThemeSwitcher[true] ?? collect();
|
||||
$itemsAfterThemeSwitcher = $itemsBeforeAndAfterThemeSwitcher[false] ?? collect();
|
||||
|
||||
$hasProfileHeader = $itemsBeforeThemeSwitcher->has('profile') &&
|
||||
$hasProfileHeader =
|
||||
$itemsBeforeThemeSwitcher->has('profile') &&
|
||||
blank(($item = Arr::first($itemsBeforeThemeSwitcher))->getUrl()) &&
|
||||
(! $item->hasAction());
|
||||
!$item->hasAction();
|
||||
|
||||
if ($itemsBeforeThemeSwitcher->has('profile')) {
|
||||
$itemsBeforeThemeSwitcher = $itemsBeforeThemeSwitcher->prepend($itemsBeforeThemeSwitcher->pull('profile'), 'profile');
|
||||
$itemsBeforeThemeSwitcher = $itemsBeforeThemeSwitcher->prepend(
|
||||
$itemsBeforeThemeSwitcher->pull('profile'),
|
||||
'profile',
|
||||
);
|
||||
}
|
||||
|
||||
$position ??= filament()->getUserMenuPosition();
|
||||
@@ -32,45 +36,30 @@
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::USER_MENU_BEFORE) }}
|
||||
|
||||
<x-filament::dropdown
|
||||
:placement="($position === UserMenuPosition::Topbar) ? 'bottom-end' : 'top-end'"
|
||||
:teleport="$position === UserMenuPosition::Topbar"
|
||||
:attributes="
|
||||
\Filament\Support\prepare_inherited_attributes($attributes)
|
||||
->class(['fi-user-menu'])
|
||||
"
|
||||
>
|
||||
<x-filament::dropdown :placement="$position === UserMenuPosition::Topbar ? 'bottom-end' : 'top-end'" :teleport="$position === UserMenuPosition::Topbar" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-user-menu'])">
|
||||
<x-slot name="trigger">
|
||||
@if ($position === UserMenuPosition::Topbar)
|
||||
<button
|
||||
aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}"
|
||||
type="button"
|
||||
class="fi-user-menu-trigger"
|
||||
>
|
||||
<button aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}" type="button"
|
||||
class="fi-user-menu-trigger">
|
||||
<x-filament-panels::avatar.user :user="$user" loading="lazy" />
|
||||
</button>
|
||||
@else
|
||||
<button
|
||||
aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}"
|
||||
type="button"
|
||||
class="fi-user-menu-trigger"
|
||||
>
|
||||
<button aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}" type="button"
|
||||
class="fi-user-menu-trigger">
|
||||
<x-filament-panels::avatar.user :user="$user" loading="lazy" />
|
||||
|
||||
<span
|
||||
@if ($isSidebarCollapsibleOnDesktop)
|
||||
x-show="$store.sidebar.isOpen"
|
||||
@endif
|
||||
class="fi-user-menu-trigger-text"
|
||||
>
|
||||
<span @if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen" @endif
|
||||
class="fi-user-menu-trigger-text">
|
||||
{{ filament()->getUserName($user) }}
|
||||
</span>
|
||||
|
||||
{{
|
||||
\Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronUp, alias: \Filament\View\PanelsIconAlias::USER_MENU_TOGGLE_BUTTON, attributes: new \Illuminate\View\ComponentAttributeBag([
|
||||
{{ \Filament\Support\generate_icon_html(
|
||||
\Filament\Support\Icons\Heroicon::ChevronUp,
|
||||
alias: \Filament\View\PanelsIconAlias::USER_MENU_TOGGLE_BUTTON,
|
||||
attributes: new \Illuminate\View\ComponentAttributeBag([
|
||||
'x-show' => $isSidebarCollapsibleOnDesktop ? '$store.sidebar.isOpen' : null,
|
||||
]))
|
||||
}}
|
||||
]),
|
||||
) }}
|
||||
</button>
|
||||
@endif
|
||||
</x-slot>
|
||||
@@ -109,7 +98,7 @@
|
||||
</x-filament::dropdown.list>
|
||||
@endif
|
||||
|
||||
@if (filament()->hasDarkMode() && (! filament()->hasDarkModeForced()))
|
||||
@if (filament()->hasDarkMode() && !filament()->hasDarkModeForced())
|
||||
<x-filament::dropdown.list>
|
||||
<x-filament-panels::theme-switcher />
|
||||
</x-filament::dropdown.list>
|
||||
|
||||
Reference in New Issue
Block a user