final filters ok
This commit is contained in:
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) {
|
||||
$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 = []) {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
<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"
|
||||
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>
|
||||
|
||||
@role('partner_porgramm')
|
||||
<x-filament::button size="xs" tooltip="Show Partner Odds" wire:click="toggleShowPartner" :color="auth()->user()->partner_show ? 'info' : 'gray'"
|
||||
icon="phosphor-users">
|
||||
<x-filament::button size="xs" tooltip="Show {{ auth()->user()->partnerbookmaker->name }}"
|
||||
wire:click="toggleShowPartner" :color="auth()->user()->partner_show ? 'info' : 'gray'" icon="phosphor-users-duotone">
|
||||
</x-filament::button>
|
||||
|
||||
<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 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>
|
||||
@endrole
|
||||
|
||||
@switch(auth()->user()->all_only_none)
|
||||
@case(0)
|
||||
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="gray" icon="phosphor-gps"
|
||||
tooltip="Showing with or without {{ auth()->user()->bookmaker->name }}">
|
||||
</x-filament::button>
|
||||
@break
|
||||
|
||||
@case(1)
|
||||
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" icon="phosphor-gps-fix" color="info"
|
||||
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
|
||||
|
||||
|
||||
<x-filament::button size="xs" wire:click="setAllOnlyNone(0)" :color="auth()->user()->all_only_none == 0 ? 'info' : 'gray'" icon="phosphor-stack-duotone"
|
||||
tooltip="All Events">
|
||||
</x-filament::button>
|
||||
<x-filament::button size="xs" wire:click="setAllOnlyNone(1)" icon="phosphor-plus-square-duotone"
|
||||
:color="auth()->user()->all_only_none == 1 ? 'away' : 'gray'" tooltip="Events with {{ auth()->user()->bookmaker->name }}">
|
||||
</x-filament::button>
|
||||
<x-filament::button size="xs" wire:click="setAllOnlyNone(2)" :color="auth()->user()->all_only_none == 2 ? 'away' : 'gray'"
|
||||
icon="phosphor-minus-square-duotone" tooltip="Events without {{ auth()->user()->bookmaker->name }}">
|
||||
</x-filament::button>
|
||||
|
||||
<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 notes" wire:click="toggleNote" color="gray" icon="phosphor-note" />
|
||||
<x-filament::button size="xs" tooltip="Filter alarm notification" wire:click="toggleNotification" color="gray" icon="phosphor-bell" />
|
||||
<x-filament::button size="xs" tooltip="Filter favorits" wire:click="toggleStar" color="gray"
|
||||
icon="phosphor-star-duotone" />
|
||||
<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>
|
||||
|
||||
@foreach ($bettype_toggles as $toggle)
|
||||
<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>
|
||||
@if ($toggle['short'] == 'TQ')
|
||||
<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' : 'away'">
|
||||
<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
|
||||
</div>
|
||||
@@ -178,10 +178,10 @@
|
||||
|
||||
{{-- 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">
|
||||
<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">
|
||||
</x-filament::icon-button>
|
||||
</x-slot>
|
||||
|
||||
Reference in new issue
Block a user