From 5ec71f1a1d96e80601507e9e1c5cb0894147042c Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 5 Feb 2026 08:04:32 +0100 Subject: [PATCH] final filters ok --- .../Resources/Events/Tables/EventsTable.php | 34 +++++++-- app/Livewire/BettypeToggle.php | 18 +++-- .../views/livewire/bettype-toggle.blade.php | 70 +++++++++---------- .../views/livewire/top-menu-items.blade.php | 4 +- 4 files changed, 76 insertions(+), 50 deletions(-) diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index d7fb7847..08d22c47 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -406,6 +406,10 @@ class EventsTable function (Builder $query, $filter_stars) { $query->whereHas('event_user_star'); } + )->when(in_array('odds_tq', self::$bettype_settings), + function (Builder $query, $filter_stars) { + $query->whereHas('odds_tq'); + } )->when( $data['filter_notes'], function (Builder $query, $filter_notes) { @@ -471,15 +475,33 @@ class EventsTable } if ($data['filter_stars'] ?? null) { - $indicators[] = Indicator::make('Filter Favorits')->removeField('filter_stars')->color('info'); + $indicators[] = Indicator::make('Favorits')->removeField('filter_stars')->color('info'); + } + + if (in_array('odds_tq', self::$bettype_settings)) { + $indicators[] = Indicator::make('To Qualify')->color('away')->removable(false); + } + + if (auth()->user()->all_only_none == 1) { + $indicators[] = Indicator::make('Only with '.auth()->user()->bookmaker->name)->color('away')->removable(false); + } + if (auth()->user()->all_only_none == 2) { + $indicators[] = Indicator::make('Only without '.auth()->user()->bookmaker->name)->color('away')->removable(false); + } + + if (auth()->user()->partner_show == 1) { + $indicators[] = Indicator::make('With '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false); + } + if (auth()->user()->partner_compare == 1) { + $indicators[] = Indicator::make('Difference '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false); } if ($data['filter_notes'] ?? null) { - $indicators[] = Indicator::make('Filter Notes')->removeField('filter_notes')->color('info'); + $indicators[] = Indicator::make('Notes')->removeField('filter_notes')->color('info'); } if ($data['filter_notification'] ?? null) { - $indicators[] = Indicator::make('Filter Notifications')->removeField('filter_notification')->color('info'); + $indicators[] = Indicator::make('Notifications')->removeField('filter_notification')->color('info'); } if ($data['filter_alarm_green'] ?? null) { @@ -580,7 +602,7 @@ class EventsTable if (isset($record->event_user_star->id)) { return 'phosphor-star-fill'; } else { - return 'phosphor-star'; + return 'phosphor-star-duotone'; } }) ->tooltip('Add to favorits') @@ -595,7 +617,7 @@ class EventsTable } }), Action::make('event_note') - ->modalIcon('phosphor-note') + ->modalIcon('phosphor-note-pencil-duotone') ->modalWidth(Width::Large) ->modalSubmitActionLabel('Save') ->extraModalFooterActions(fn (Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')]) @@ -617,7 +639,7 @@ class EventsTable ->rows(2) ->hiddenLabel(), ]) - ->icon('phosphor-note-pencil') + ->icon('phosphor-note-pencil-duotone') ->iconButton() ->tooltip(fn ($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note])) ->action(function ($record, array $data, $arguments = []) { diff --git a/app/Livewire/BettypeToggle.php b/app/Livewire/BettypeToggle.php index 84ee9675..842e43fa 100644 --- a/app/Livewire/BettypeToggle.php +++ b/app/Livewire/BettypeToggle.php @@ -106,15 +106,19 @@ class BettypeToggle extends Component $this->dispatch('filterUpdatePeriode', json_encode($data)); } - public function toggelAllOnlyNone() + public function setOneWeek() + { + $data = [ + 'start' => Carbon::today()->format('Y-m-d 00:00:00'), + 'end' => Carbon::today()->addDays(7)->format('Y-m-d 00:00:00'), + ]; + $this->dispatch('filterUpdatePeriode', json_encode($data)); + } + + public function setAllOnlyNone($value) { - $user = User::where('id', auth()->user()->id)->first(); - $user->all_only_none++; - if ($user->all_only_none == 3) { - $user->all_only_none = 0; - } - $user->save(); + $user = User::where('id', auth()->user()->id)->update(['all_only_none' => $value]); $this->dispatch('refreshBettypeMenu'); } diff --git a/resources/views/livewire/bettype-toggle.blade.php b/resources/views/livewire/bettype-toggle.blade.php index bcd8d502..d48904b7 100644 --- a/resources/views/livewire/bettype-toggle.blade.php +++ b/resources/views/livewire/bettype-toggle.blade.php @@ -1,21 +1,25 @@
- + + icon="phosphor-calendar-check-duotone" /> +
@role('partner_porgramm') - + + tooltip="Differences {{ auth()->user()->bookmaker->name }} vs {{ auth()->user()->partnerbookmaker->name }}" + :disabled="auth()->user()->partner_show ? false : true" :color="auth()->user()->partner_compare ? 'info' : 'gray'" icon="phosphor-exclude-square-duotone">
@endrole - @switch(auth()->user()->all_only_none) - @case(0) - - - @break - - @case(1) - - - @break - - @case(2) - - - @break - - @default - @endswitch - - + + + + + +
- - - + + +
@foreach ($bettype_toggles as $toggle) - -
{{ $toggle['short'] }}
-
+ @if ($toggle['short'] == 'TQ') + +
{{ $toggle['short'] }}
+
+ @else + +
{{ $toggle['short'] }}
+
+ @endif @endforeach diff --git a/resources/views/livewire/top-menu-items.blade.php b/resources/views/livewire/top-menu-items.blade.php index aefc849e..269f0bc0 100644 --- a/resources/views/livewire/top-menu-items.blade.php +++ b/resources/views/livewire/top-menu-items.blade.php @@ -178,10 +178,10 @@ {{-- Alarm --}} - -