From 9bf5890441b2478c7e607d76b1ec391c6ca33913 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 24 Aug 2026 15:34:34 +0200 Subject: [PATCH] wip --- app/Filament/Pages/Statistic.php | 42 ++++++++-------- app/Filament/Widgets/StatsMedianAverage.php | 2 - .../views/filament/pages/statistic.blade.php | 48 +++++++++---------- 3 files changed, 44 insertions(+), 48 deletions(-) diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 94bbf1e4..e4012cc8 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -86,10 +86,10 @@ class Statistic extends BaseDashboard Select::make('league_id') ->live() ->searchable() - ->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger') + ->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger') ->prefixIcon('phosphor-trophy-fill') ->hiddenLabel() - ->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1)) + ->options(fn() => LoadStatisticFixturesLeaguesOptions::load(1)) ->placeholder('League') ->afterStateUpdated(function (callable $set, $state) { $set('match_id', null); @@ -100,7 +100,7 @@ class Statistic extends BaseDashboard Select::make('match_id') ->live() ->hiddenLabel() - ->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger') + ->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger') ->prefixIcon('phosphor-calendar-check-fill') ->options(function (Get $get) { return LoadStatisticFixturesMatchOptions::load($get('league_id')); @@ -124,7 +124,7 @@ class Statistic extends BaseDashboard } }) ->prefixIcon('phosphor-users-three-fill') - ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') + ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') ->options(function (Get $get) { if ($get('match_id')) { $res = StatisticFixtures::where('id', $get('match_id'))->first(); @@ -152,9 +152,9 @@ class Statistic extends BaseDashboard Action::make('iconInfo') ->color('success') ->icon('phosphor-question-fill') - ->tooltip(fn () => 'Team Position') + ->tooltip(fn() => 'Team Position') ) - ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') + ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') ->default('all') ->selectablePlaceholder(false) ->options([ @@ -207,13 +207,13 @@ class Statistic extends BaseDashboard ->hiddenLabel() ->prefix('SPM') ->placeholder('Similar Past Matches') - ->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('
± '.$get('accuracy').'
') : '') + ->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('
± ' . $get('accuracy') . '
') : '') ->prefixAction( Action::make('iconInfo') ->icon('phosphor-question-fill') // ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary') ->color('success') - ->tooltip(fn () => $this->tooltip_similar_past_matches()) + ->tooltip(fn() => $this->tooltip_similar_past_matches()) ) ->default('none') ->selectablePlaceholder(false) @@ -230,7 +230,7 @@ class Statistic extends BaseDashboard Slider::make('accuracy') ->live() ->hiddenLabel() - ->hidden(fn (Get $get) => $get('similar_past_matches') == 'none') + ->hidden(fn(Get $get) => $get('similar_past_matches') == 'none') ->fillTrack() ->minValue(0) ->maxValue(0.25) @@ -246,17 +246,17 @@ class Statistic extends BaseDashboard ->hiddenLabel() ->allowHtml() ->placeholder('Player') - ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') - ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '') + ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') + ->prefixIconColor(fn(Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '') ->prefixIcon('icon-player') ->preload() ->searchable() - ->extraAttributes(fn () => ['id' => 'player_selector']) + ->extraAttributes(fn() => ['id' => 'player_selector']) ->suffixAction( Action::make('iconInfo') ->icon('phosphor-question-fill') ->color('success') - ->tooltip(fn () => $this->tooltip_player_info()) + ->tooltip(fn() => $this->tooltip_player_info()) ) ->options(function (Get $get) { return LoadPlayer::load($get); @@ -267,7 +267,7 @@ class Statistic extends BaseDashboard ->placeholder('Time on field') ->prefixIcon('phosphor-watch-fill') ->default('all') - ->hidden(fn (Get $get) => ! $get('ss_player_id')) + ->hidden(fn(Get $get) => ! $get('ss_player_id')) ->prefixIconColor('success') ->selectablePlaceholder(false) ->options([ @@ -307,7 +307,7 @@ class Statistic extends BaseDashboard ->placeholder('All Seasons') ->prefixIconColor('success') // ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary') - ->hidden(fn (Get $get) => $get('season_or_date') == 'date') + ->hidden(fn(Get $get) => $get('season_or_date') == 'date') ->prefixIcon('phosphor-calendar-star-fill') ->preload() ->options(function (Get $get) { @@ -316,30 +316,30 @@ class Statistic extends BaseDashboard DatePicker::make('start_date') ->live() ->hiddenLabel() - ->hidden(fn (Get $get) => $get('season_or_date') == 'season') + ->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->native(false) - ->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary') + ->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary') ->prefixIcon('phosphor-calendar-fill') ->prefix('Start') ->suffixAction( Action::make('clear_start') ->icon('phosphor-x') ->color('gray') - ->action(fn (Set $set) => $set('start_date', null)) + ->action(fn(Set $set) => $set('start_date', null)) ), DatePicker::make('end_date') ->live() ->hiddenLabel() - ->hidden(fn (Get $get) => $get('season_or_date') == 'season') + ->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->native(false) - ->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary') + ->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary') ->prefixIcon('phosphor-calendar-fill') ->prefix('End') ->suffixAction( Action::make('clear_end') ->icon('phosphor-x') ->color('gray') - ->action(fn (Set $set) => $set('end_date', null)) + ->action(fn(Set $set) => $set('end_date', null)) ), ]); } diff --git a/app/Filament/Widgets/StatsMedianAverage.php b/app/Filament/Widgets/StatsMedianAverage.php index e0fad360..383afbce 100644 --- a/app/Filament/Widgets/StatsMedianAverage.php +++ b/app/Filament/Widgets/StatsMedianAverage.php @@ -68,8 +68,6 @@ class StatsMedianAverage extends StatsOverviewWidget break; } - - // Log::debug($data['datasets']); $team_position = HelperTeamPosition::get($this->filters); diff --git a/resources/views/filament/pages/statistic.blade.php b/resources/views/filament/pages/statistic.blade.php index 356887d5..020e3735 100644 --- a/resources/views/filament/pages/statistic.blade.php +++ b/resources/views/filament/pages/statistic.blade.php @@ -33,31 +33,29 @@ - @if ($this->filters['team_id']) - -
- -
- @livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters]) -
- - -
- @livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters]) -
- -
- @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) -
- -
- @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) -
+ +
+ +
+ @livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartEventMoAv::class, ['filters' => $this->filters])
- @endif + + +
+ @livewire(\App\Filament\Widgets\ChartEventPerf::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters]) +
+ +
+ @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) +
+ +
+ @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) +
+