wip
This commit is contained in:
1 parent
6fb6fef00e
commit
f5de71de09
1 file changed
+43
-56
@@ -19,7 +19,7 @@ use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Slider;
|
||||
use Filament\Pages\Dashboard as BaseDashboard;
|
||||
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Components\Utilities\Set;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -50,14 +50,14 @@ class Statistic extends BaseDashboard
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Fieldset::make('Events')
|
||||
->dense()
|
||||
->columns([
|
||||
Grid::make([
|
||||
'default' => 2,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 4,
|
||||
])->extraAttributes([
|
||||
])
|
||||
->columnSpanFull()
|
||||
->extraAttributes([
|
||||
'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800',
|
||||
])
|
||||
->schema([
|
||||
@@ -110,6 +110,43 @@ class Statistic extends BaseDashboard
|
||||
'away' => 'Away',
|
||||
]),
|
||||
|
||||
Select::make('statistic_type')
|
||||
->columnSpan([
|
||||
'default' => 1,
|
||||
'xl' => 2,
|
||||
])
|
||||
->prefixIcon('phosphor-cell-signal-full')
|
||||
->default('none')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
'gls' => 'Goals',
|
||||
'crn' => 'Corner',
|
||||
'fls' => 'Fouls commited',
|
||||
'ofs' => 'Offside',
|
||||
'crd' => 'Cards',
|
||||
'snt' => 'Shot on target',
|
||||
'tsh' => 'Total shots',
|
||||
]),
|
||||
DatePicker::make('start_date')
|
||||
->native(false)
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->suffixAction(
|
||||
Action::make('clear_start')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('start_date', null))
|
||||
),
|
||||
DatePicker::make('end_date')
|
||||
->native(false)
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->suffixAction(
|
||||
Action::make('clear_end')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('end_date', null))
|
||||
),
|
||||
Select::make('similar_past_matches')
|
||||
->prefixIcon('phosphor-align-center-horizontal')
|
||||
->suffixAction(
|
||||
@@ -129,7 +166,7 @@ class Statistic extends BaseDashboard
|
||||
Slider::make('accuracy')
|
||||
->hiddenLabel()
|
||||
->disabled(fn (Get $get) => $get('similar_past_matches') == 'none')
|
||||
->fillTrack()
|
||||
// ->fillTrack()
|
||||
->default(5)
|
||||
->step(0.1)
|
||||
->decimalPlaces(1)
|
||||
@@ -137,20 +174,6 @@ class Statistic extends BaseDashboard
|
||||
->range(minValue: 0, maxValue: 1)
|
||||
->pips()
|
||||
->live(),
|
||||
])->columns(6)
|
||||
->columnSpanFull(),
|
||||
Fieldset::make('Player')
|
||||
->dense()
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->columns([
|
||||
'default' => 2,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 4,
|
||||
])->extraAttributes([
|
||||
'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800',
|
||||
])
|
||||
->schema([
|
||||
Select::make('tm_player_id')
|
||||
->label('Player')
|
||||
->prefixIcon('icon-player')
|
||||
@@ -181,43 +204,7 @@ class Statistic extends BaseDashboard
|
||||
'substituted' => 'Substituted',
|
||||
])
|
||||
->live(),
|
||||
Select::make('statistic_type')
|
||||
->prefixIcon('phosphor-cell-signal-full')
|
||||
->default('none')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
'gls' => 'Goals',
|
||||
'crn' => 'Corner',
|
||||
'fls' => 'Fouls commited',
|
||||
'ofs' => 'Offside',
|
||||
'crd' => 'Cards',
|
||||
'snt' => 'Shot on target',
|
||||
'tsh' => 'Total shots',
|
||||
]),
|
||||
|
||||
DatePicker::make('start_date')
|
||||
->native(false)
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->suffixAction(
|
||||
Action::make('clear_start')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('start_date', null))
|
||||
),
|
||||
DatePicker::make('end_date')
|
||||
->native(false)
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->suffixAction(
|
||||
Action::make('clear_end')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn (Set $set) => $set('end_date', null))
|
||||
),
|
||||
])->columns(5)
|
||||
->columnSpanFull(),
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user