final filters ok

This commit is contained in:
salam committed 2026-02-05 08:04:32 +01:00
1 parent b329254fc7
commit 5ec71f1a1d
4 files changed
+76 -50

No files matched your search

@@ -406,6 +406,10 @@ class EventsTable
function (Builder $query, $filter_stars) { function (Builder $query, $filter_stars) {
$query->whereHas('event_user_star'); $query->whereHas('event_user_star');
} }
)->when(in_array('odds_tq', self::$bettype_settings),
function (Builder $query, $filter_stars) {
$query->whereHas('odds_tq');
}
)->when( )->when(
$data['filter_notes'], $data['filter_notes'],
function (Builder $query, $filter_notes) { function (Builder $query, $filter_notes) {
@@ -471,15 +475,33 @@ class EventsTable
} }
if ($data['filter_stars'] ?? null) { 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) { 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) { 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) { if ($data['filter_alarm_green'] ?? null) {
@@ -580,7 +602,7 @@ class EventsTable
if (isset($record->event_user_star->id)) { if (isset($record->event_user_star->id)) {
return 'phosphor-star-fill'; return 'phosphor-star-fill';
} else { } else {
return 'phosphor-star'; return 'phosphor-star-duotone';
} }
}) })
->tooltip('Add to favorits') ->tooltip('Add to favorits')
@@ -595,7 +617,7 @@ class EventsTable
} }
}), }),
Action::make('event_note') Action::make('event_note')
->modalIcon('phosphor-note') ->modalIcon('phosphor-note-pencil-duotone')
->modalWidth(Width::Large) ->modalWidth(Width::Large)
->modalSubmitActionLabel('Save') ->modalSubmitActionLabel('Save')
->extraModalFooterActions(fn (Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')]) ->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) ->rows(2)
->hiddenLabel(), ->hiddenLabel(),
]) ])
->icon('phosphor-note-pencil') ->icon('phosphor-note-pencil-duotone')
->iconButton() ->iconButton()
->tooltip(fn ($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note])) ->tooltip(fn ($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note]))
->action(function ($record, array $data, $arguments = []) { ->action(function ($record, array $data, $arguments = []) {
+11 -7
View File
@@ -106,15 +106,19 @@ class BettypeToggle extends Component
$this->dispatch('filterUpdatePeriode', json_encode($data)); $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 = User::where('id', auth()->user()->id)->update(['all_only_none' => $value]);
$user->all_only_none++;
if ($user->all_only_none == 3) {
$user->all_only_none = 0;
}
$user->save();
$this->dispatch('refreshBettypeMenu'); $this->dispatch('refreshBettypeMenu');
} }
@@ -1,21 +1,25 @@
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<x-filament::button size="xs" tooltip="Today" wire:click="setToday" color="gray" icon="phosphor-calendar-dot" /> <x-filament::button size="xs" tooltip="Today" wire:click="setToday" color="gray"
icon="phosphor-calendar-dot-duotone" />
<x-filament::button size="xs" tooltip="Tomorrow" wire:click="setTomorrow" color="gray" <x-filament::button size="xs" tooltip="Tomorrow" wire:click="setTomorrow" color="gray"
icon="phosphor-calendar-check" /> icon="phosphor-calendar-check-duotone" />
<x-filament::button size="xs" tooltip="One Week" wire:click="setOneWeek" color="gray"
icon="phosphor-calendar-plus-duotone" />
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
@role('partner_porgramm') @role('partner_porgramm')
<x-filament::button size="xs" tooltip="Show Partner Odds" wire:click="toggleShowPartner" :color="auth()->user()->partner_show ? 'info' : 'gray'" <x-filament::button size="xs" tooltip="Show {{ auth()->user()->partnerbookmaker->name }}"
icon="phosphor-users"> wire:click="toggleShowPartner" :color="auth()->user()->partner_show ? 'info' : 'gray'" icon="phosphor-users-duotone">
</x-filament::button> </x-filament::button>
<x-filament::button disabled="true" size="xs" wire:click="toggleComparePartner" <x-filament::button disabled="true" size="xs" wire:click="toggleComparePartner"
tooltip="Filter Partner Differences" :disabled="auth()->user()->partner_show ? false : true" :color="auth()->user()->partner_compare ? 'info' : 'gray'" icon="phosphor-funnel"> 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">
</x-filament::button> </x-filament::button>
<x-filament::button size="xs" wire:click="toggleMultiline" :tooltip="auth()->user()->is_multiline_direct ? 'Multiline slots are disabled' : 'Multiline slots are active'" :color="auth()->user()->is_multiline_direct ? 'info' : 'gray'" <x-filament::button size="xs" wire:click="toggleMultiline" :tooltip="auth()->user()->is_multiline_direct ? 'Multiline slots are disabled' : 'Multiline slots are active'" :color="auth()->user()->is_multiline_direct ? 'info' : 'gray'"
@@ -26,45 +30,41 @@
<div></div> <div></div>
@endrole @endrole
@switch(auth()->user()->all_only_none) <x-filament::button size="xs" wire:click="setAllOnlyNone(0)" :color="auth()->user()->all_only_none == 0 ? 'info' : 'gray'" icon="phosphor-stack-duotone"
@case(0) tooltip="All Events">
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="gray" icon="phosphor-gps" </x-filament::button>
tooltip="Showing with or without {{ auth()->user()->bookmaker->name }}"> <x-filament::button size="xs" wire:click="setAllOnlyNone(1)" icon="phosphor-plus-square-duotone"
</x-filament::button> :color="auth()->user()->all_only_none == 1 ? 'away' : 'gray'" tooltip="Events with {{ auth()->user()->bookmaker->name }}">
@break </x-filament::button>
<x-filament::button size="xs" wire:click="setAllOnlyNone(2)" :color="auth()->user()->all_only_none == 2 ? 'away' : 'gray'"
@case(1) icon="phosphor-minus-square-duotone" tooltip="Events without {{ auth()->user()->bookmaker->name }}">
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" icon="phosphor-gps-fix" color="info" </x-filament::button>
tooltip="Showing all with {{ auth()->user()->bookmaker->name }}">
</x-filament::button>
@break
@case(2)
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="danger" icon="phosphor-gps-slash"
tooltip="Showing all without {{ auth()->user()->bookmaker->name }}">
</x-filament::button>
@break
@default
@endswitch
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<x-filament::button size="xs" tooltip="Filter favorits" wire:click="toggleStar" color="gray" icon="phosphor-star" /> <x-filament::button size="xs" tooltip="Filter favorits" wire:click="toggleStar" color="gray"
<x-filament::button size="xs" tooltip="Filter notes" wire:click="toggleNote" color="gray" icon="phosphor-note" /> icon="phosphor-star-duotone" />
<x-filament::button size="xs" tooltip="Filter alarm notification" wire:click="toggleNotification" color="gray" icon="phosphor-bell" /> <x-filament::button size="xs" tooltip="Filter notes" wire:click="toggleNote" color="gray"
icon="phosphor-note-duotone" />
<x-filament::button size="xs" tooltip="Filter alarm notification" wire:click="toggleNotification"
color="gray" icon="phosphor-bell-duotone" />
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
@foreach ($bettype_toggles as $toggle) @foreach ($bettype_toggles as $toggle)
<x-filament::button size="xs" class="flex flex-col justify-center gap-0" tooltip="{{ $toggle['name'] }}" @if ($toggle['short'] == 'TQ')
wire:click="toggleBettype({{ $toggle['id'] }})" :color="!$toggle['is_active'] ? 'gray' : 'info'"> <x-filament::button size="xs" class="flex flex-col justify-center gap-0"
<div class="m-0 p-0">{{ $toggle['short'] }}</div> tooltip="{{ $toggle['name'] }}" wire:click="toggleBettype({{ $toggle['id'] }})" :color="!$toggle['is_active'] ? 'gray' : 'away'">
</x-filament::button> <div class="m-0 p-0">{{ $toggle['short'] }}</div>
</x-filament::button>
@else
<x-filament::button size="xs" class="flex flex-col justify-center gap-0"
tooltip="{{ $toggle['name'] }}" wire:click="toggleBettype({{ $toggle['id'] }})" :color="!$toggle['is_active'] ? 'gray' : 'info'">
<div class="m-0 p-0">{{ $toggle['short'] }}</div>
</x-filament::button>
@endif
@endforeach @endforeach
</div> </div>
@@ -178,10 +178,10 @@
{{-- Alarm --}} {{-- Alarm --}}
<x-filament::modal slide-over width="4xl" icon="phosphor-siren" :close-by-clicking-away="true" :close-by-escaping="true" <x-filament::modal slide-over width="4xl" icon="phosphor-siren-duotone" :close-by-clicking-away="true" :close-by-escaping="true"
:close-button="true"> :close-button="true">
<x-slot name="trigger"> <x-slot name="trigger">
<x-filament::icon-button outlined icon="phosphor-siren" color="gray" class="my-auto" <x-filament::icon-button outlined icon="phosphor-siren-duotone" color="gray" class="my-auto"
title="Alarm Settings"> title="Alarm Settings">
</x-filament::icon-button> </x-filament::icon-button>
</x-slot> </x-slot>