design wip
This commit is contained in:
1 parent
07b9dfac44
commit
fbacfdde20
10 files changed
+154
-144
No files matched your search
@@ -237,7 +237,10 @@ class Odds
|
||||
'competition_group_id' => (int) $row->group['cgid'],
|
||||
];
|
||||
|
||||
Event::firstOrCreate(['id' => (int) $row['id']], $event);
|
||||
$res = Event::firstOrCreate(['id' => (int) $row['id']], $event);
|
||||
if ($res) {
|
||||
$event_id = $res->id;
|
||||
}
|
||||
|
||||
$group = [
|
||||
'competition_group_id' => (string) $row->group['cgid'],
|
||||
|
||||
@@ -14,7 +14,6 @@ class ListEvents extends ListRecords
|
||||
protected string|Width|null $maxContentWidth = Width::Full;
|
||||
|
||||
protected $listeners = [
|
||||
'refreshBettypeMenu' => '$refresh',
|
||||
'filterClearFilter' => 'clearFilters',
|
||||
'filterUpdateGreen' => 'updateTableFiltersGreen',
|
||||
'filterUpdateYellow' => 'updateTableFiltersYellow',
|
||||
@@ -22,7 +21,6 @@ class ListEvents extends ListRecords
|
||||
'filterUpdatePeriode' => 'updateTablePeriode',
|
||||
'filterStarFilter' => 'updateStar',
|
||||
'filterNoteFilter' => 'updateNote',
|
||||
'filterNotificationFilter' => 'updateNotification',
|
||||
];
|
||||
|
||||
protected function getHeaderWidgets(): array
|
||||
@@ -34,11 +32,10 @@ class ListEvents extends ListRecords
|
||||
|
||||
public function clearFilters(): void
|
||||
{
|
||||
foreach ($this->tableFilters['events'] as $key => $value) {
|
||||
$this->tableFilters['events'][$key] = null;
|
||||
}
|
||||
$this->removeTableFilters();
|
||||
|
||||
// $this->dispatch('refreshMapperLeft');
|
||||
|
||||
// $this->dispatch('refreshMapperRight');
|
||||
}
|
||||
|
||||
public function updateCompareDifferences(): void
|
||||
|
||||
@@ -185,7 +185,6 @@ class EventsTable
|
||||
Hidden::make('filter_alarm_red'),
|
||||
Hidden::make('filter_stars'),
|
||||
Hidden::make('filter_notes'),
|
||||
Hidden::make('filter_notification'),
|
||||
Hidden::make('filter_periode'),
|
||||
Select::make(name: 'country_id')
|
||||
->hidden(fn () => auth()->user()->sport_id == 5)
|
||||
@@ -447,24 +446,24 @@ class EventsTable
|
||||
if ($data['country_id'] ?? null) {
|
||||
$countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray();
|
||||
if (count($countries) > 1) {
|
||||
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('info');
|
||||
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('Country: '.$countries[0])->removeField('country_id')->color('info');
|
||||
$indicators[] = Indicator::make('Country: '.$countries[0])->removeField('country_id')->color('warning');
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['group_id'] ?? null) {
|
||||
$group_ids = Group::whereIn('id', $data['group_id'])->pluck('name')->toArray();
|
||||
if (count($group_ids) > 1) {
|
||||
$indicators[] = Indicator::make('Tournament: '.implode(', ', $group_ids))->removeField('group_id')->color('info');
|
||||
$indicators[] = Indicator::make('Tournament: '.implode(', ', $group_ids))->removeField('group_id')->color('warning');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('Tournaments: '.$group_ids[0])->removeField('group_id')->color('info');
|
||||
$indicators[] = Indicator::make('Tournaments: '.$group_ids[0])->removeField('group_id')->color('warning');
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['client_group_list_id'] ?? null) {
|
||||
$client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name');
|
||||
$indicators[] = Indicator::make('Custom Group: '.$client_group_list_name)->removeField('client_group_list_id')->color('info');
|
||||
$indicators[] = Indicator::make('Custom Group: '.$client_group_list_name)->removeField('client_group_list_id')->color('warning');
|
||||
}
|
||||
|
||||
if ($data['filter_stars'] ?? null) {
|
||||
@@ -472,14 +471,14 @@ class EventsTable
|
||||
}
|
||||
|
||||
if (in_array('odds_tq', self::$bettype_settings)) {
|
||||
$indicators[] = Indicator::make('To Qualify')->color('away')->removable(false);
|
||||
$indicators[] = Indicator::make('To Qualify')->color('info')->removable(false);
|
||||
}
|
||||
|
||||
if (auth()->user()->all_only_none == 1) {
|
||||
$indicators[] = Indicator::make('Only events with '.auth()->user()->bookmaker->name)->color('away')->removable(false);
|
||||
$indicators[] = Indicator::make('With '.auth()->user()->bookmaker->name)->color('info')->removable(false);
|
||||
}
|
||||
if (auth()->user()->all_only_none == 2) {
|
||||
$indicators[] = Indicator::make('Only events without '.auth()->user()->bookmaker->name)->color('away')->removable(false);
|
||||
$indicators[] = Indicator::make('Without '.auth()->user()->bookmaker->name)->color('info')->removable(false);
|
||||
}
|
||||
|
||||
if (auth()->user()->partner_show == 1) {
|
||||
@@ -490,17 +489,13 @@ class EventsTable
|
||||
}
|
||||
|
||||
if (auth()->user()->bookmaker_partner_differences == 1) {
|
||||
$indicators[] = Indicator::make('Different events '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('home')->removable(false);
|
||||
$indicators[] = Indicator::make('Different events '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false);
|
||||
}
|
||||
|
||||
if ($data['filter_notes'] ?? null) {
|
||||
$indicators[] = Indicator::make('Notes')->removeField('filter_notes')->color('info');
|
||||
}
|
||||
|
||||
if ($data['filter_notification'] ?? null) {
|
||||
$indicators[] = Indicator::make('Notifications')->removeField('filter_notification')->color('home');
|
||||
}
|
||||
|
||||
if ($data['filter_alarm_green'] ?? null) {
|
||||
$title = OddsTable::where('name', $data['filter_alarm_green'])->value('title');
|
||||
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_green')->color('success');
|
||||
@@ -526,32 +521,32 @@ class EventsTable
|
||||
$text .= ' To '.Carbon::parse($span['end'])->toFormattedDateString();
|
||||
}
|
||||
if ($text) {
|
||||
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('info');
|
||||
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('warning');
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['competition_group_id'] ?? null) {
|
||||
$competition_groups = CompetitionGroup::whereIn('id', $data['competition_group_id'])->pluck('name')->toArray();
|
||||
if (count($competition_groups) > 1) {
|
||||
$indicators[] = Indicator::make('Leagues: '.implode(', ', $competition_groups))->removeField('competition_group_id')->color('info');
|
||||
$indicators[] = Indicator::make('Leagues: '.implode(', ', $competition_groups))->removeField('competition_group_id')->color('warning');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('League: '.$competition_groups[0])->removeField('competition_group_id')->color('info')->color('info');
|
||||
$indicators[] = Indicator::make('League: '.$competition_groups[0])->removeField('competition_group_id')->color('info')->color('warning');
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['favorit_threshold'] ?? null) {
|
||||
switch (auth()->user()->sport_id) {
|
||||
case 1:
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||
break;
|
||||
case 2:
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||
break;
|
||||
case 3:
|
||||
$indicators[] = Indicator::make('HC Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
$indicators[] = Indicator::make('HC Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||
break;
|
||||
case 5:
|
||||
$indicators[] = Indicator::make('ML Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
$indicators[] = Indicator::make('ML Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,11 @@ class BettypeToggle extends Component
|
||||
return view('livewire.bettype-toggle');
|
||||
}
|
||||
|
||||
public function clearAllFilter()
|
||||
{
|
||||
$this->dispatch('filterClearFilter');
|
||||
}
|
||||
|
||||
public function toggleBettype($multiline_setting_id)
|
||||
{
|
||||
BettypeUser::where('multiline_setting_id', $multiline_setting_id)->update(['is_active' => DB::raw('!is_active')]);
|
||||
@@ -78,11 +83,6 @@ class BettypeToggle extends Component
|
||||
$this->dispatch('filterNoteFilter');
|
||||
}
|
||||
|
||||
public function toggleNotification()
|
||||
{
|
||||
$this->dispatch('filterNotificationFilter');
|
||||
}
|
||||
|
||||
public function toggleShowPartner()
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['partner_compare' => 0, 'partner_show' => DB::raw('!partner_show')]);
|
||||
|
||||
Reference in new issue
Block a user