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 @@