design wip
This commit is contained in:
1 parent
70a443db6b
commit
eb11298d24
22 files changed
+418
-81
No files matched your search
@@ -147,7 +147,6 @@ class EventsTable
|
||||
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(250)
|
||||
->label('Totals Q1'),
|
||||
|
||||
TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)),
|
||||
|
||||
@@ -195,9 +195,9 @@ class TooltipOdds extends Column
|
||||
public function getFlags($flags)
|
||||
{
|
||||
if ($flags) {
|
||||
return '<div class="pb-0.5 text-green-600">✓</div>';
|
||||
return '<div class="pb-0.5 text-md font-bold text-green-600">✓</div>';
|
||||
} else {
|
||||
return '<div class="pb-0.5 text-info-600">⚠</div>';
|
||||
return '<div class="pb-0.5 text-md font-bold text-info-600">⚠</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,9 +208,9 @@ class TooltipOdds extends Column
|
||||
|
||||
public function legend()
|
||||
{
|
||||
$part = '<div class="col-span-full font-normal flex justify-end gap-2" style="font-size:10px">';
|
||||
$part .= '<div class="w-12 bg-green-600/25 rounded py-0.5 px-2">Highest</div>';
|
||||
$part .= '<div class="w-12 bg-blue-600/25 rounded py-0.5 px-2">Lowest</div>';
|
||||
$part = '<div class="col-span-full font-normal flex justify-end gap-2 text-xs">';
|
||||
$part .= '<div class="bg-green-600/25 rounded py-0.5 px-2 w-16 text-center">Highest</div>';
|
||||
$part .= '<div class="bg-blue-600/25 rounded py-0.5 px-2 w-16 text-center">Lowest</div>';
|
||||
$part .= '</div>';
|
||||
|
||||
return $part;
|
||||
@@ -270,15 +270,15 @@ class TooltipOdds extends Column
|
||||
|
||||
if ($this->size > $this->two_cols_break) {
|
||||
if ($columns == 6) {
|
||||
$part = '<div class="grid grid-cols-15 gap-2 m-5 mt-1 z-100 text-xs text-center">';
|
||||
$part = '<div class="grid grid-cols-15 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
|
||||
} else {
|
||||
$part = '<div class="grid grid-cols-13 gap-2 m-5 mt-1 z-100 text-xs text-center">';
|
||||
$part = '<div class="grid grid-cols-13 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
|
||||
}
|
||||
} else {
|
||||
if ($columns == 6) {
|
||||
$part = '<div class="grid grid-cols-7 gap-2 m-5 mt-1 z-100 text-xs text-center">';
|
||||
$part = '<div class="grid grid-cols-7 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
|
||||
} else {
|
||||
$part = '<div class="grid grid-cols-6 gap-2 m-5 mt-1 z-100 text-xs text-center">';
|
||||
$part = '<div class="grid grid-cols-6 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
|
||||
}
|
||||
}
|
||||
$part .= '<div class="col-span-full text-center text-md font-bold mb-2">'.$title.'</div>';
|
||||
|
||||
@@ -29,7 +29,7 @@ class AlarmBookmaker extends Component implements HasActions, HasSchemas, HasTab
|
||||
use InteractsWithTable;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_alarm_bookmaker' => '$refresh',
|
||||
'refreshlarmBookmaker' => '$refresh',
|
||||
];
|
||||
|
||||
public static $default_filter;
|
||||
|
||||
@@ -34,7 +34,7 @@ class ComparingBookmakerMenu extends Component implements HasActions, HasSchemas
|
||||
public $user;
|
||||
|
||||
protected $listeners = [
|
||||
'refresh_comparing_bookmaker' => '$refresh',
|
||||
'refreshComparingBookmakerMenu' => '$refresh',
|
||||
];
|
||||
|
||||
public function table(Table $table): Table
|
||||
|
||||
@@ -45,7 +45,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
public $user;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_left' => '$refresh',
|
||||
'refreshMapperLeft' => '$refresh',
|
||||
];
|
||||
|
||||
public function removeTableFilter(string $filterName, ?string $field = null, bool $shouldTriggerUpdatedFiltersHook = true): void
|
||||
@@ -62,7 +62,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->search_left = '';
|
||||
}
|
||||
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
@@ -152,7 +152,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
->persistFiltersInSession()
|
||||
->deferFilters(false)
|
||||
->toolbarActions([
|
||||
Action::make('reload_data_left')
|
||||
Action::make('refreshMapperLeft')
|
||||
->hiddenLabel()
|
||||
->icon('phosphor-x')
|
||||
->color('danger')
|
||||
@@ -162,7 +162,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->tableSearch = ''; // Clears the main search bar
|
||||
$livewire->fill(['tableSearch' => '']);
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
$this->search_left = $str;
|
||||
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}
|
||||
|
||||
public function leftAction(): Action
|
||||
@@ -196,8 +196,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
StoreMapped::store($arguments, $this->elements_swopped);
|
||||
$this->search_right = '';
|
||||
$this->search_left = '';
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
|
||||
})
|
||||
->closeModalByEscaping(false)
|
||||
|
||||
@@ -42,7 +42,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
public $search_right = false;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_right' => '$refresh',
|
||||
'refreshMapperRight' => '$refresh',
|
||||
];
|
||||
|
||||
public $user;
|
||||
@@ -61,7 +61,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->search_right = '';
|
||||
}
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
@@ -165,7 +165,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->filtersFormColumns(3)
|
||||
->deferFilters(false)
|
||||
->toolbarActions([
|
||||
Action::make('reload_data_right')
|
||||
Action::make('refreshMapperRight')
|
||||
->hiddenLabel()
|
||||
->icon('phosphor-x')
|
||||
->color('danger')
|
||||
@@ -175,8 +175,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->tableSearch = ''; // Clears the main search bar
|
||||
$livewire->fill(['tableSearch' => '']);
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
$this->search_right = $str;
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
|
||||
public function rightAction(): Action
|
||||
@@ -209,8 +209,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
StoreMapped::store($arguments, $this->elements_swopped);
|
||||
$this->search_right = '';
|
||||
$this->search_left = '';
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
})
|
||||
->closeModalByEscaping(false)
|
||||
->modalCloseButton(false)
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Filament\Tables\Columns\BookmakerIcon;
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\MultilineClient;
|
||||
use App\Models\MultilineSetting;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Forms\Components\Radio;
|
||||
@@ -32,18 +31,13 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
use InteractsWithTable;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_bookmaker_multiline' => '$refresh',
|
||||
'refreshMultilineBookmaker' => '$refresh',
|
||||
];
|
||||
|
||||
public $user;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
|
||||
$this->user = User::getUser();
|
||||
|
||||
return $table
|
||||
->query(MultilineClient::query()->where('client_bookmaker_id', $this->user->bookmaker_id)->where('sport_id', $this->user->sport_id))
|
||||
->query(MultilineClient::query()->where('client_bookmaker_id', auth()->user()->bookmaker_id)->where('sport_id', auth()->user()->sport_id))
|
||||
->paginated(false)
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
@@ -62,7 +56,7 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
$table = MultilineSetting::where('id', $livewire->tableFilters['multiline_setting_id'])->value('table');
|
||||
|
||||
$bookies = DB::table($table)
|
||||
->where('sport_id', $this->user->sport_id)
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->groupBy('bookmaker_id')->pluck('bookmaker_id');
|
||||
|
||||
$res = Bookmaker::whereIn('id', $bookies)->pluck('name', 'id');
|
||||
@@ -81,12 +75,13 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
Filter::make('multiline_setting_id')
|
||||
->schema([
|
||||
Radio::make('multiline_setting_id')
|
||||
->extraAttributes(['id' => 'multiline_setting'])
|
||||
->inline()
|
||||
->default(1)
|
||||
->default(fn ($record) => MultilineSetting::where('sport_id', auth()->user()->sport_id)->pluck('id')->first())
|
||||
->columnSpan(6)
|
||||
->columnSpanFull()
|
||||
->hiddenLabel()
|
||||
->options(fn () => MultilineSetting::where('sport_id', $this->user->sport_id)->orderBy('name')->pluck('name', 'id')),
|
||||
->options(fn () => MultilineSetting::where('sport_id', auth()->user()->sport_id)->orderBy('name')->pluck('name', 'id')),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query
|
||||
|
||||
@@ -48,6 +48,17 @@ class SportSwitcher extends Component
|
||||
$this->dispatch('filterClearFilter');
|
||||
|
||||
$this->dispatch('refreshSportSwitcher');
|
||||
|
||||
$this->dispatch('refreshMultilineBookmaker');
|
||||
|
||||
$this->dispatch('refreshComparingBookmakerMenu');
|
||||
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
|
||||
$this->dispatch('refreshMapperRight');
|
||||
|
||||
$this->dispatch('refreshlarmBookmaker');
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -13,8 +13,8 @@ class TopMenuItems extends Component
|
||||
public $current = '';
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_left' => '$refresh',
|
||||
'reload_data_right' => '$refresh',
|
||||
'refreshMapperLeft' => '$refresh',
|
||||
'refreshMapperRight' => '$refresh',
|
||||
];
|
||||
|
||||
protected string $sport = '';
|
||||
@@ -50,6 +50,6 @@ class TopMenuItems extends Component
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id]);
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user