diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 58c13df5..a853bec0 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -92,7 +92,6 @@ class Statistic extends BaseDashboard ->modalHeading('') ->label('Calculate') ->icon('icon-player') - ->color('indigo') ->color(fn (): string => $this->filters['team_id'] ? 'primary' : 'gray') ->disabled(fn (): string => $this->filters['team_id'] ? false : true) ->slideOver() diff --git a/app/Livewire/BoardDispatcher.php b/app/Livewire/BoardDispatcher.php index 08eae71d..f4010ae4 100644 --- a/app/Livewire/BoardDispatcher.php +++ b/app/Livewire/BoardDispatcher.php @@ -12,13 +12,15 @@ use Filament\Schemas\Concerns\InteractsWithSchemas; use Filament\Schemas\Concerns\RestrictsFileUploadsToSchemaComponents; use Filament\Schemas\Contracts\HasSchemas; use Filament\Schemas\Schema; +use Filament\Support\Enums\Size; +use Filament\Support\Enums\SlideOverPosition; +use Filament\Support\Enums\Width; use Filament\Tables\Columns\ViewColumn; use Filament\Tables\Concerns\InteractsWithTable; use Filament\Tables\Contracts\HasTable; use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Filters\SelectFilter; use Filament\Tables\Table; -use Illuminate\Support\Facades\Log; use Illuminate\Support\HtmlString; use Livewire\Attributes\On; use Livewire\Component; @@ -178,8 +180,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa public function getHeadingTable(): HtmlString { - return new HtmlString('
'.$this->ss_team_name.'
-
+ return new HtmlString('
Gls
Fls
Ofs
@@ -200,7 +201,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa Select::make('lineup_selected') ->live() ->hiddenLabel() - ->columnSpan(1) + ->columnSpan(2) ->prefix('Lineup') ->prefixIcon('icon-soccerplayer') ->searchable() @@ -215,17 +216,44 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa { return $table ->headerActions([ + // FilamentView::registerRenderHook( + // PanelsRenderHook::GLOBAL_SEARCH_AFTER, + // fn (): View => view('filament.modals.position-abbreviation'), + // ); Action::make('close') + ->size(Size::Small) + ->tooltip('Close application') + ->hiddenLabel() ->icon('phosphor-x') ->close(), + Action::make('lineups') + ->size(Size::Small) + ->tooltip('Lineup abbreviation explanation') + ->hiddenLabel() + ->icon('phosphor-question-mark') + ->slideOver() + ->slideOverPosition(SlideOverPosition::Start) + ->modalWidth(Width::ExtraLarge) + ->modalSubmitAction(false) + ->modalCancelAction(false) + ->modalContent(fn () => view('filament.modals.position-abbreviation')), Action::make('reset') + ->hiddenLabel() + ->size(Size::Small) + ->tooltip('Remove all players from field') ->icon('phosphor-arrows-clockwise') ->action(fn () => $this->clearAll()), Action::make('calculate') + ->hiddenLabel() + ->tooltip('Calculate expected values') + ->size(Size::Small) ->icon('phosphor-calculator') ->disabled($this->calculationDisabled) ->action(fn () => $this->calculateAspg()), Action::make('copy') + ->tooltip('Copy results for pasting into a spread sheet') + ->hiddenLabel() + ->size(Size::Small) ->icon('phosphor-copy') ->disabled($this->copyDisabled) ->action(fn () => $this->copyResult()), @@ -242,17 +270,17 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa ViewColumn::make('drag_card') ->columnSpanFull() ->label(fn () => $this->getHeadingTable()) - ->view('filament.tables.columns.drag-card') - ->extraAttributes([ - // Limits height, forces scrollbar, and switches layout to block to respect max-height - 'class' => 'max-h-[150px] overflow-y-auto block p-2 bg-gray-50 dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-700', - ]), + ->view('filament.tables.columns.drag-card'), ]) ->filters([ - SelectFilter::make('player_position') + SelectFilter::make('position_area') ->columnSpanFull() ->native(false) ->options([ + // 'attack' => 'Attack', + // 'midfield' => 'Midfield', + // 'defence' => 'Denfence', + // 'goalkeeper' => 'Goalkeeper', 'attack' => 'Attack', 'midfield' => 'Midfield', 'defence' => 'Defence', @@ -260,14 +288,17 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa ])->modifyFormFieldUsing(fn (Select $component) => $component->allowHtml()) ->query(function ($query) { return $query; + })->indicateUsing(function (array $data): array { + // WICHTIG: Ein leeres Array sorgt dafür, dass kein Indicator-Badge erzeugt wird + return []; }), ], layout: FiltersLayout::AboveContent) ->deferFilters(false) ->records(function () { $collection = collect($this->sourceRecords); - $selectedPosition = $this->tableFilters['player_position']['value'] ?? null; + $selectedPosition = $this->tableFilters['position_area']['value'] ?? null; if (! empty($selectedPosition)) { - $collection = $collection->where('player_position', $selectedPosition); + $collection = $collection->where('position_area', $selectedPosition); } return $collection; diff --git a/app/Livewire/PlayerCalculator.php b/app/Livewire/PlayerCalculator.php index 20248027..9271d345 100644 --- a/app/Livewire/PlayerCalculator.php +++ b/app/Livewire/PlayerCalculator.php @@ -89,23 +89,23 @@ class PlayerCalculator extends Component if (in_array($val['player_position'], $positions_map['MIDFIELD'])) { $player_position = $val['player_position']; - $player_position_field = 'midfield'; + $position_area = 'midfield'; $player_color = 'info'; } elseif (in_array($val['player_position'], $positions_map['DEFENCE'])) { $player_position = $val['player_position']; - $player_position_field = 'defence'; + $position_area = 'defence'; $player_color = 'success'; } elseif (in_array($val['player_position'], $positions_map['ATTACK'])) { $player_position = $val['player_position']; - $player_position_field = 'attack'; + $position_area = 'attack'; $player_color = 'warning'; } elseif (in_array($val['player_position'], $positions_map['GOALKEEPER'])) { $player_position = $val['player_position']; - $player_position_field = 'goalkeeper'; + $position_area = 'goalkeeper'; $player_color = 'gray'; } else { $player_position = 'NO SPECIFIC POSITION'; - $player_position_field = 'non'; + $position_area = 'non'; $player_color = 'danger'; } @@ -127,7 +127,7 @@ class PlayerCalculator extends Component 'name' => $val['player_name'], 'preferred_foot' => $val['preferred_foot'], 'player_position' => $player_position, - 'player_position_field' => $player_position_field, + 'position_area' => $position_area, 'player_color' => $player_color, 'timed_color' => $timed_color, 'events_played' => $events_played, @@ -144,7 +144,9 @@ class PlayerCalculator extends Component ]; } - $sort = array_column($result, 'player_position'); + $pos = array_column($result, 'player_position'); + $area = array_column($result, 'position_area'); + array_multisort($area, SORT_ASC, $pos, SORT_ASC, $result); return $result; } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 4abace98..9052f797 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -13,7 +13,6 @@ use Filament\Support\Facades\FilamentTimezone; use Filament\Support\Facades\FilamentView; use Filament\Tables\View\TablesRenderHook; use Filament\View\PanelsRenderHook; -use Illuminate\Contracts\View\View; use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; use Illuminate\Support\ServiceProvider; @@ -36,6 +35,7 @@ class AppServiceProvider extends ServiceProvider FilamentTimezone::set('Europe/Vienna'); + /** Alpine Plugin direct */ FilamentView::registerRenderHook( 'panels::head.end', fn (): HtmlString => new HtmlString(' @@ -76,10 +76,10 @@ class AppServiceProvider extends ServiceProvider fn (): string => Blade::render('@livewire(\'top-menu-items\')') ); - FilamentView::registerRenderHook( - PanelsRenderHook::GLOBAL_SEARCH_AFTER, - fn (): View => view('filament.modals.position-abbreviation'), - ); + // FilamentView::registerRenderHook( + // PanelsRenderHook::GLOBAL_SEARCH_AFTER, + // fn (): View => view('filament.modals.position-abbreviation'), + // ); Carbon::setLocale(app()->getLocale()); diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index cb875c80..e9821b9e 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -11,6 +11,22 @@ @source '../../../../vendor/jaocero/radio-deck/resources/views'; +@layer utilities { + + /* Versteckt den Scrollbalken für Chrome, Safari und Opera */ + .no-scrollbar::-webkit-scrollbar { + display: none; + } + + /* Versteckt den Scrollbalken für IE, Edge und Firefox */ + .no-scrollbar { + -ms-overflow-style: none; + /* IE and Edge */ + scrollbar-width: none; + /* Firefox */ + } +} + /* Reduce gap between widgets and content */ .fi-page-content { @apply gap-y-5; diff --git a/resources/views/filament/modals/position-abbreviation.blade.php b/resources/views/filament/modals/position-abbreviation.blade.php index 409d07db..fa054cb1 100644 --- a/resources/views/filament/modals/position-abbreviation.blade.php +++ b/resources/views/filament/modals/position-abbreviation.blade.php @@ -1,11 +1,4 @@ - - - - - -
Player positions explanation of abbreviations
- +
@@ -27,143 +20,137 @@
- - - - - - - +
AbbreviationDescription
- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -171,374 +158,362 @@
ST
ST Centre-Forward
ST-AM Centre-Forward, Attacking Midfield
ST-MC Centre-Forward, Central Midfield
ST-DC Centre-Forward, Centre-Back
ST-DM Centre-Forward, Defensive Midfield
ST-ML Centre-Forward, Left Midfield
ST-LW Centre-Forward, Left Winger
ST-DL Centre-Forward, Left-Back
ST-MR Centre-Forward, Right Midfield
ST-RW Centre-Forward, Right Winger
ST-DR Centre-Forward, Right-Back
LW Left Winger
LW-AM Left Winger, Attacking Midfield
LW-MC Left Winger, Central Midfield
LW-DC Left Winger, Centre-Back
LW-ST Left Winger, Centre-Forward
LW-DM Left Winger, Defensive Midfield
LW-ML Left Winger, Left Midfield
LW-DL Left Winger, Left-Back
LW-MR Left Winger, Right Midfield
LW-RW Left Winger, Right Winger
LW-DR Left Winger, Right-Back
RW Right Winger
RW-AM Right Winger, Attacking Midfield
RW-MC Right Winger, Central Midfield
RW-DC Right Winger, Centre-Back
RW-ST Right Winger, Centre-Forward
RW-DM Right Winger, Defensive Midfield
RW-ML Right Winger, Left Midfield
RW-LW Right Winger, Left Winger
RW-DL Right Winger, Left-Back
RW-MR Right Winger, Right Midfield
RW-DR Right Winger, Right-Back
- - - - - - - +
AbbreviationDescription
- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
DC
DC Centre-Back
DL Left-Back
DR Right-Back
DC-AM Centre-Back, Attacking Midfield
DL-AM Left-Back, Attacking Midfield
DR-AM Right-Back, Attacking Midfield
DL-DC Left-Back, Centre-Back
DR-DC Right-Back, Centre-Back
DC-DL Centre-Back, Left-Back
DR-DL Right-Back, Left-Back
DC-DM Centre-Back, Defensive Midfield
DL-DM Left-Back, Defensive Midfield
DR-DM Right-Back, Defensive Midfield
DC-DR Centre-Back, Right-Back
DL-DR Left-Back, Right-Back
DC-LW Centre-Back, Left Winger
DL-LW Left-Back, Left Winger
DR-LW Right-Back, Left Winger
DC-MC Centre-Back, Central Midfield
DL-MC Left-Back, Central Midfield
DR-MC Right-Back, Central Midfield
DC-ML Centre-Back, Left Midfield
DL-ML Left-Back, Left Midfield
DR-ML Right-Back, Left Midfield
DC-MR Centre-Back, Right Midfield
DL-MR Left-Back, Right Midfield
DR-MR Right-Back, Right Midfield
DC-RW Centre-Back, Right Winger
DL-RW Left-Back, Right Winger
DR-RW Right-Back, Right Winger
DC-ST Centre-Back, Centre-Forward
DL-ST Left-Back, Centre-Forward
DR-ST Right-Back, Centre-Forward
- - - - - - - +
AbbreviationDescription
- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -546,16 +521,10 @@
AM
AM Attacking Midfield
DM Defensive Midfield
MC Central Midfield
ML Left Midfield
MR Right Midfield
DM-AM Defensive Midfield, Attacking Midfield
MC-AM Central Midfield, Attacking Midfield
ML-AM Left Midfield, Attacking Midfield
MR-AM Right Midfield, Attacking Midfield
AM-DC Attacking Midfield, Centre-Back
DM-DC Defensive Midfield, Centre-Back
MC-DC Central Midfield, Centre-Back
ML-DC Left Midfield, Centre-Back
MR-DC Right Midfield, Centre-Back
AM-DL Attacking Midfield, Left-Back
DM-DL Defensive Midfield, Left-Back
MC-DL Central Midfield, Left-Back
ML-DL Left Midfield, Left-Back
MR-DL Right Midfield, Left-Back
AM-DM Attacking Midfield, Defensive Midfield
MC-DM Central Midfield, Defensive Midfield
ML-DM Left Midfield, Defensive Midfield
MR-DM Right Midfield, Defensive Midfield
AM-DR Attacking Midfield, Right-Back
DM-DR Defensive Midfield, Right-Back
MC-DR Central Midfield, Right-Back
ML-DR Left Midfield, Right-Back
MR-DR Right Midfield, Right-Back
AM-LW Attacking Midfield, Left Winger
DM-LW Defensive Midfield, Left Winger
MC-LW Central Midfield, Left Winger
ML-LW Left Midfield, Left Winger
MR-LW Right Midfield, Left Winger
AM-MC Attacking Midfield, Central Midfield
DM-MC Defensive Midfield, Central Midfield
ML-MC Left Midfield, Central Midfield
MR-MC Right Midfield, Central Midfield
AM-ML Attacking Midfield, Left Midfield
DM-ML Defensive Midfield, Left Midfield
MC-ML Central Midfield, Left Midfield
MR-ML Right Midfield, Left Midfield
AM-MR Attacking Midfield, Right Midfield
DM-MR Defensive Midfield, Right Midfield
MC-MR Central Midfield, Right Midfield
ML-MR Left Midfield, Right Midfield
AM-RW Attacking Midfield, Right Winger
DM-RW Defensive Midfield, Right Winger
MC-RW Central Midfield, Right Winger
ML-RW Left Midfield, Right Winger
MR-RW Right Midfield, Right Winger
AM-ST Attacking Midfield, Centre-Forward
DM-ST Defensive Midfield, Centre-Forward
MC-ST Central Midfield, Centre-Forward
ML-ST Left Midfield, Centre-Forward
MR-ST Right Midfield, Centre-Forward
- - - - - - - +
AbbreviationDescription
- - + + @@ -563,4 +532,4 @@ - + diff --git a/resources/views/filament/tables/columns/drag-card.blade.php b/resources/views/filament/tables/columns/drag-card.blade.php index e5c8b8b1..13fc9a25 100644 --- a/resources/views/filament/tables/columns/drag-card.blade.php +++ b/resources/views/filament/tables/columns/drag-card.blade.php @@ -3,7 +3,7 @@ @endphp @if ($record['active'])
+ class="w-140 max-w-140 border dark:border-gray-600 border-gray-200 text-xs my-0.5 py-1 select-none rounded transition-colors flex justify-end content-center items-center gap-1">
{{ $record['gls'] }}
{{ $record['fls'] }}
@@ -33,7 +33,7 @@ e.dataTransfer.effectAllowed = 'copy'; e.dataTransfer.setData('text/plain', JSON.stringify({ id: {{ $record['id'] }} })); }" - class="border dark:border-gray-600 border-gray-200 w-full text-xs my-0.5 py-1 select-none cursor-grab active:cursor-grabbing rounded transition-colors flex justify-end content-center items-center gap-1"> + class="w-140 max-w-140 border dark:border-gray-600 border-gray-200 text-xs my-0.5 mx-0 py-1 select-none cursor-grab active:cursor-grabbing rounded transition-colors flex justify-end content-center items-center gap-1">
{{ $record['gls'] }}
{{ $record['fls'] }}
diff --git a/resources/views/livewire/board-dispatcher.blade.php b/resources/views/livewire/board-dispatcher.blade.php index 909ea5ee..93587f3b 100644 --- a/resources/views/livewire/board-dispatcher.blade.php +++ b/resources/views/livewire/board-dispatcher.blade.php @@ -1,59 +1,72 @@ -@php - use Illuminate\Support\Facades\Log; -@endphp -
-
+
+
{{ $this->table }}
-
-
- {{ $this->form }} +
+
+
{{ $this->form }}
+
{{ $ss_team_name }}
-
@foreach ($beschriftung as $boxNumber => $benennung) - @if ($benennung && in_array($boxNumber, $lineup)) -
- -
-
-
- {{ $benennung }} + @if ($benennung) + @if(in_array($boxNumber, $lineup)) +
+ +
+
+
+ {{ $benennung }} +
+ + @if ($boxes[$boxNumber]) + + @endif
+ @if ($boxes[$boxNumber]) - +
+ {{ $boxes[$boxNumber]['name'] }} +
@endif
- - - @if ($boxes[$boxNumber]) -
- {{ $boxes[$boxNumber]['name'] }} -
- @endif -
+ @else + + @endif @else
@endif
GK
GK Goaldkeeper