phases one of time logged now with log display
This commit is contained in:
+37
-45
@@ -21,12 +21,14 @@
|
||||
use Filament\Tables\Enums\RecordCheckboxPosition;
|
||||
|
||||
if ($groupsOnly && $groupColumn) {
|
||||
$columns = collect($columns)
|
||||
->reject(fn (Column $column): bool => $column->getName() === $groupColumn)
|
||||
->all();
|
||||
$columns = collect($columns)->reject(fn(Column $column): bool => $column->getName() === $groupColumn)->all();
|
||||
}
|
||||
|
||||
$hasPageSummary = $pageSummary && (! $groupsOnly) && $records instanceof \Illuminate\Contracts\Pagination\Paginator && $records->hasPages();
|
||||
$hasPageSummary =
|
||||
$pageSummary &&
|
||||
!$groupsOnly &&
|
||||
$records instanceof \Illuminate\Contracts\Pagination\Paginator &&
|
||||
$records->hasPages();
|
||||
|
||||
$pageTableSummaryQuery = $hasPageSummary ? $this->getPageTableSummaryQuery() : null;
|
||||
$allTableSummaryQuery = $allTableSummary ? $this->getAllTableSummaryQuery() : null;
|
||||
@@ -34,7 +36,10 @@
|
||||
|
||||
@if ($hasPageSummary)
|
||||
<tr class="fi-ta-row fi-ta-summary-header-row fi-striped">
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -50,30 +55,30 @@
|
||||
|
||||
@foreach ($columns as $column)
|
||||
@php
|
||||
$columnHasSummary = ($pageTableSummaryQuery && $column->hasSummary($pageTableSummaryQuery)) || $column->hasSummary($allTableSummaryQuery);
|
||||
$columnHasSummary =
|
||||
($pageTableSummaryQuery && $column->hasSummary($pageTableSummaryQuery)) ||
|
||||
$column->hasSummary($allTableSummaryQuery);
|
||||
@endphp
|
||||
|
||||
@if ($placeholderColumns || $columnHasSummary)
|
||||
@php
|
||||
$alignment = $column->getAlignment() ?? Alignment::Start;
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
if (!$alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
|
||||
}
|
||||
|
||||
$hasColumnHeaderLabel = (! $placeholderColumns) || $columnHasSummary;
|
||||
$hasColumnHeaderLabel = !$placeholderColumns || $columnHasSummary;
|
||||
@endphp
|
||||
|
||||
<td
|
||||
{{
|
||||
$column->getExtraHeaderAttributeBag()->class([
|
||||
{{ $column->getExtraHeaderAttributeBag()->class([
|
||||
'fi-ta-cell fi-ta-summary-header-cell',
|
||||
'fi-wrapped' => $column->canHeaderWrap(),
|
||||
(($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : '')) => (! ($loop->first && (! $extraHeadingColumn))) && $hasColumnHeaderLabel,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($loop->first && (! $extraHeadingColumn))
|
||||
$alignment instanceof Alignment ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : '') =>
|
||||
!($loop->first && !$extraHeadingColumn) && $hasColumnHeaderLabel,
|
||||
]) }}>
|
||||
@if ($loop->first && !$extraHeadingColumn)
|
||||
{{ __('filament-tables::table.summary.heading', ['label' => $pluralModelLabel]) }}
|
||||
@elseif ($hasColumnHeaderLabel)
|
||||
{{ $column->getLabel() }}
|
||||
@@ -82,7 +87,10 @@
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -95,18 +103,8 @@
|
||||
$selectedState = $this->getTableSummarySelectedState($pageTableSummaryQuery)[0] ?? [];
|
||||
@endphp
|
||||
|
||||
<x-filament-tables::summary.row
|
||||
:actions="$actions"
|
||||
:actions-position="$actionsPosition"
|
||||
:columns="$columns"
|
||||
:extra-heading-column="$extraHeadingColumn"
|
||||
:heading="__('filament-tables::table.summary.subheadings.page', ['label' => $pluralModelLabel])"
|
||||
:placeholder-columns="$placeholderColumns"
|
||||
:query="$pageTableSummaryQuery"
|
||||
:record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState"
|
||||
:selection-enabled="$selectionEnabled"
|
||||
/>
|
||||
<x-filament-tables::summary.row :actions="$actions" :actions-position="$actionsPosition" :columns="$columns" :extra-heading-column="$extraHeadingColumn"
|
||||
:heading="__('filament-tables::table.summary.subheadings.page', ['label' => $pluralModelLabel])" :placeholder-columns="$placeholderColumns" :query="$pageTableSummaryQuery" :record-checkbox-position="$recordCheckboxPosition" :selected-state="$selectedState" :selection-enabled="$selectionEnabled" />
|
||||
@endif
|
||||
|
||||
@if ($allTableSummary)
|
||||
@@ -114,20 +112,14 @@
|
||||
$selectedState = $this->getTableSummarySelectedState($allTableSummaryQuery)[0] ?? [];
|
||||
@endphp
|
||||
|
||||
<x-filament-tables::summary.row
|
||||
:actions="$actions"
|
||||
:actions-position="$actionsPosition"
|
||||
:columns="$columns"
|
||||
:extra-heading-column="$extraHeadingColumn"
|
||||
:groups-only="$groupsOnly"
|
||||
:heading="__(($hasPageSummary ? 'filament-tables::table.summary.subheadings.all' : 'filament-tables::table.summary.heading'), ['label' => $pluralModelLabel])"
|
||||
:placeholder-columns="$placeholderColumns"
|
||||
:query="$allTableSummaryQuery"
|
||||
:record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState"
|
||||
:selection-enabled="$selectionEnabled"
|
||||
@class([
|
||||
'fi-striped' => ! $hasPageSummary,
|
||||
])
|
||||
/>
|
||||
<x-filament-tables::summary.row :actions="$actions" :actions-position="$actionsPosition" :columns="$columns" :extra-heading-column="$extraHeadingColumn"
|
||||
:groups-only="$groupsOnly" :heading="__(
|
||||
$hasPageSummary
|
||||
? 'filament-tables::table.summary.subheadings.all'
|
||||
: 'filament-tables::table.summary.heading',
|
||||
['label' => $pluralModelLabel],
|
||||
)" :placeholder-columns="$placeholderColumns" :query="$allTableSummaryQuery" :record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState" :selection-enabled="$selectionEnabled" @class([
|
||||
'fi-striped' => !$hasPageSummary,
|
||||
]) />
|
||||
@endif
|
||||
|
||||
@@ -20,14 +20,15 @@
|
||||
use Filament\Tables\Enums\RecordCheckboxPosition;
|
||||
|
||||
if ($groupsOnly && $groupColumn) {
|
||||
$columns = collect($columns)
|
||||
->reject(fn (Column $column): bool => $column->getName() === $groupColumn)
|
||||
->all();
|
||||
$columns = collect($columns)->reject(fn(Column $column): bool => $column->getName() === $groupColumn)->all();
|
||||
}
|
||||
@endphp
|
||||
|
||||
<tr {{ $attributes->class(['fi-ta-row fi-ta-summary-row']) }}>
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -58,26 +59,31 @@
|
||||
@endif
|
||||
|
||||
@foreach ($columns as $column)
|
||||
@if (($loop->first || $extraHeadingColumn || $groupsOnly || ($loop->iteration > $headingColumnSpan)) && ($placeholderColumns || $column->hasSummary($query)))
|
||||
@if (
|
||||
($loop->first || $extraHeadingColumn || $groupsOnly || $loop->iteration > $headingColumnSpan) &&
|
||||
($placeholderColumns || $column->hasSummary($query)))
|
||||
@php
|
||||
$alignment = $column->getAlignment() ?? Alignment::Start;
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
if (!$alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<td
|
||||
colspan="{{ ($loop->first && (! $extraHeadingColumn) && (! $groupsOnly) && ($headingColumnSpan > 1)) ? $headingColumnSpan : null }}"
|
||||
<td colspan="{{ $loop->first && !$extraHeadingColumn && !$groupsOnly && $headingColumnSpan > 1 ? $headingColumnSpan : null }}"
|
||||
@class([
|
||||
'fi-ta-cell',
|
||||
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : ''),
|
||||
'fi-ta-summary-row-heading-cell' => $loop->first && (! $extraHeadingColumn) && (! $groupsOnly),
|
||||
])
|
||||
>
|
||||
@if ($loop->first && (! $extraHeadingColumn) && (! $groupsOnly))
|
||||
$alignment instanceof Alignment
|
||||
? "fi-align-{$alignment->value}"
|
||||
: (is_string($alignment)
|
||||
? $alignment
|
||||
: ''),
|
||||
'fi-ta-summary-row-heading-cell' =>
|
||||
$loop->first && !$extraHeadingColumn && !$groupsOnly,
|
||||
])>
|
||||
@if ($loop->first && !$extraHeadingColumn && !$groupsOnly)
|
||||
{{ $heading }}
|
||||
@elseif ((! $placeholderColumns) || $column->hasSummary($query))
|
||||
@elseif (!$placeholderColumns || $column->hasSummary($query))
|
||||
@foreach ($column->getSummarizers($query) as $summarizer)
|
||||
{{ $summarizer->query($query)->selectedState($selectedState) }}
|
||||
@endforeach
|
||||
@@ -86,7 +92,10 @@
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user