phases one of time logged now with log display
This commit is contained in:
+33
-87
@@ -13,31 +13,16 @@
|
||||
$hasDropdown = filled($label) && filled($icon) && $sidebarCollapsible;
|
||||
@endphp
|
||||
|
||||
<li
|
||||
x-data="{ label: @js($subNavigation ? "sub_navigation_{$label}" : $label) }"
|
||||
data-group-label="{{ $subNavigation ? "sub_navigation_{$label}" : $label }}"
|
||||
<li x-data="{ label: @js($subNavigation ? "sub_navigation_{$label}" : $label) }" data-group-label="{{ $subNavigation ? "sub_navigation_{$label}" : $label }}"
|
||||
x-bind:class="{ 'fi-collapsed': $store.sidebar.groupIsCollapsed(label) }"
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-sidebar-group',
|
||||
'fi-active' => $active,
|
||||
'fi-collapsible' => $collapsible,
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $attributes->class(['fi-sidebar-group', 'fi-active' => $active, 'fi-collapsible' => $collapsible]) }}>
|
||||
@if ($label)
|
||||
<div
|
||||
@if ($collapsible)
|
||||
x-on:click="$store.sidebar.toggleCollapsedGroup(label)"
|
||||
@endif
|
||||
@if ($sidebarCollapsible)
|
||||
x-show="$store.sidebar.isOpen"
|
||||
<div @if ($collapsible) x-on:click="$store.sidebar.toggleCollapsedGroup(label)" @endif
|
||||
@if ($sidebarCollapsible) x-show="$store.sidebar.isOpen"
|
||||
x-transition:enter="fi-transition-enter"
|
||||
x-transition:enter-start="fi-transition-enter-start"
|
||||
x-transition:enter-end="fi-transition-enter-end"
|
||||
@endif
|
||||
class="fi-sidebar-group-btn"
|
||||
>
|
||||
x-transition:enter-end="fi-transition-enter-end" @endif
|
||||
class="fi-sidebar-group-btn">
|
||||
@if ($icon)
|
||||
{{ \Filament\Support\generate_icon_html($icon, size: \Filament\Support\Enums\IconSize::Large) }}
|
||||
@endif
|
||||
@@ -47,27 +32,17 @@
|
||||
</span>
|
||||
|
||||
@if ($collapsible)
|
||||
<x-filament::icon-button
|
||||
color="gray"
|
||||
:icon="\Filament\Support\Icons\Heroicon::ChevronUp"
|
||||
:icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_GROUP_COLLAPSE_BUTTON"
|
||||
:label="$label"
|
||||
x-bind:aria-expanded="! $store.sidebar.groupIsCollapsed(label)"
|
||||
x-on:click.stop="$store.sidebar.toggleCollapsedGroup(label)"
|
||||
class="fi-sidebar-group-collapse-btn"
|
||||
/>
|
||||
<x-filament::icon-button color="gray" :icon="\Filament\Support\Icons\Heroicon::ChevronUp" :icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_GROUP_COLLAPSE_BUTTON" :label="$label"
|
||||
x-bind:aria-expanded="!$store.sidebar.groupIsCollapsed(label)"
|
||||
x-on:click.stop="$store.sidebar.toggleCollapsedGroup(label)" class="fi-sidebar-group-collapse-btn" />
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasDropdown)
|
||||
<x-filament::dropdown
|
||||
:placement="(__('filament-panels::layout.direction') === 'rtl') ? 'left-start' : 'right-start'"
|
||||
x-show="! $store.sidebar.isOpen"
|
||||
>
|
||||
<x-filament::dropdown :placement="(__('filament-panels::layout.direction') === 'rtl') ? 'left-start' : 'right-start'" x-show="! $store.sidebar.isOpen">
|
||||
<x-slot name="trigger">
|
||||
<button
|
||||
x-data="{ tooltip: false }"
|
||||
<button x-data="{ tooltip: false }"
|
||||
x-effect="
|
||||
tooltip = $store.sidebar.isOpen
|
||||
? false
|
||||
@@ -77,9 +52,7 @@
|
||||
theme: $store.theme,
|
||||
}
|
||||
"
|
||||
x-tooltip.html="tooltip"
|
||||
class="fi-sidebar-group-dropdown-trigger-btn"
|
||||
>
|
||||
x-tooltip.html="tooltip" class="fi-sidebar-group-dropdown-trigger-btn">
|
||||
{{ \Filament\Support\generate_icon_html($icon, size: \Filament\Support\Enums\IconSize::Large) }}
|
||||
</button>
|
||||
</x-slot>
|
||||
@@ -89,10 +62,7 @@
|
||||
|
||||
foreach ($items as $item) {
|
||||
if ($childItems = $item->getChildItems()) {
|
||||
$lists[] = [
|
||||
$item,
|
||||
...$childItems,
|
||||
];
|
||||
$lists[] = [$item, ...$childItems];
|
||||
$lists[] = [];
|
||||
|
||||
continue;
|
||||
@@ -127,22 +97,14 @@
|
||||
$itemBadgeColor = $item->getBadgeColor($itemBadge);
|
||||
$itemBadgeTooltip = $item->getBadgeTooltip($itemBadge);
|
||||
$itemUrl = $item->getUrl();
|
||||
$itemIcon = $itemIsActive ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon();
|
||||
$itemIcon = $itemIsActive ? $item->getActiveIcon() ?? $item->getIcon() : $item->getIcon();
|
||||
$shouldItemOpenUrlInNewTab = $item->shouldOpenUrlInNewTab();
|
||||
$itemExtraAttributes = $item->getExtraAttributeBag();
|
||||
@endphp
|
||||
|
||||
<x-filament::dropdown.list.item
|
||||
:badge="$itemBadge"
|
||||
:badge-color="$itemBadgeColor"
|
||||
:badge-tooltip="$itemBadgeTooltip"
|
||||
:color="$itemIsActive ? 'primary' : 'gray'"
|
||||
:href="$itemUrl"
|
||||
:icon="$itemIcon"
|
||||
tag="a"
|
||||
:target="$shouldItemOpenUrlInNewTab ? '_blank' : null"
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)"
|
||||
>
|
||||
<x-filament::dropdown.list.item :badge="$itemBadge" :badge-color="$itemBadgeColor" :badge-tooltip="$itemBadgeTooltip"
|
||||
:color="$itemIsActive ? 'primary' : 'gray'" :href="$itemUrl" :icon="$itemIcon" tag="a" :target="$shouldItemOpenUrlInNewTab ? '_blank' : null"
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)">
|
||||
{{ $item->getLabel() }}
|
||||
</x-filament::dropdown.list.item>
|
||||
@endforeach
|
||||
@@ -151,26 +113,20 @@
|
||||
</x-filament::dropdown>
|
||||
@endif
|
||||
|
||||
<ul
|
||||
@if (filled($label))
|
||||
@if ($sidebarCollapsible)
|
||||
<ul @if (filled($label)) @if ($sidebarCollapsible)
|
||||
x-show="$store.sidebar.isOpen ? ! $store.sidebar.groupIsCollapsed(label) : ! @js($hasDropdown)"
|
||||
@else
|
||||
x-show="! $store.sidebar.groupIsCollapsed(label)"
|
||||
@endif
|
||||
x-collapse.duration.200ms
|
||||
@endif
|
||||
@if ($sidebarCollapsible)
|
||||
x-transition:enter="fi-transition-enter"
|
||||
x-show="! $store.sidebar.groupIsCollapsed(label)" @endif
|
||||
x-collapse.duration.200ms @endif
|
||||
@if ($sidebarCollapsible) x-transition:enter="fi-transition-enter"
|
||||
x-transition:enter-start="fi-transition-enter-start"
|
||||
x-transition:enter-end="fi-transition-enter-end"
|
||||
@endif
|
||||
x-transition:enter-end="fi-transition-enter-end" @endif
|
||||
class="fi-sidebar-group-items"
|
||||
>
|
||||
>
|
||||
@foreach ($items as $item)
|
||||
@php
|
||||
$isItemChildItemsActive = $item->isChildItemsActive();
|
||||
$isItemActive = (! $isItemChildItemsActive) && $item->isActive();
|
||||
$isItemActive = !$isItemChildItemsActive && $item->isActive();
|
||||
$itemActiveIcon = $item->getActiveIcon();
|
||||
$itemBadge = $item->getBadge();
|
||||
$itemBadgeColor = $item->getBadgeColor($itemBadge);
|
||||
@@ -186,29 +142,19 @@
|
||||
$itemIcon = null;
|
||||
$itemActiveIcon = null;
|
||||
} else {
|
||||
throw new \Exception('Navigation group [' . $label . '] has an icon but one or more of its items also have icons. Either the group or its items can have icons, but not both. This is to ensure a proper user experience.');
|
||||
throw new \Exception(
|
||||
'Navigation group [' .
|
||||
$label .
|
||||
'] has an icon but one or more of its items also have icons. Either the group or its items can have icons, but not both. This is to ensure a proper user experience.',
|
||||
);
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<x-filament-panels::sidebar.item
|
||||
:active="$isItemActive"
|
||||
:active-child-items="$isItemChildItemsActive"
|
||||
:active-icon="$itemActiveIcon"
|
||||
:badge="$itemBadge"
|
||||
:badge-color="$itemBadgeColor"
|
||||
:badge-tooltip="$itemBadgeTooltip"
|
||||
:child-items="$itemChildItems"
|
||||
:first="$loop->first"
|
||||
:grouped="filled($label)"
|
||||
:icon="$itemIcon"
|
||||
:last="$loop->last"
|
||||
:should-open-url-in-new-tab="$shouldItemOpenUrlInNewTab"
|
||||
:sidebar-collapsible="$sidebarCollapsible"
|
||||
:sub-navigation="$subNavigation"
|
||||
:url="$itemUrl"
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)"
|
||||
>
|
||||
<x-filament-panels::sidebar.item :active="$isItemActive" :active-child-items="$isItemChildItemsActive" :active-icon="$itemActiveIcon" :badge="$itemBadge"
|
||||
:badge-color="$itemBadgeColor" :badge-tooltip="$itemBadgeTooltip" :child-items="$itemChildItems" :first="$loop->first" :grouped="filled($label)"
|
||||
:icon="$itemIcon" :last="$loop->last" :should-open-url-in-new-tab="$shouldItemOpenUrlInNewTab" :sidebar-collapsible="$sidebarCollapsible" :sub-navigation="$subNavigation"
|
||||
:url="$itemUrl" :attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)">
|
||||
{{ $item->getLabel() }}
|
||||
|
||||
@if ($itemIcon instanceof \Illuminate\Contracts\Support\Htmlable)
|
||||
|
||||
Reference in New Issue
Block a user