File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
resources/views/admin/events Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,22 @@ public function index(Request $request)
61
61
$ params ['order ' ] = $ request ->input ('order ' );
62
62
break ;
63
63
case 'id ' :
64
- default :
65
64
$ params ['order ' ] = 'id ' ;
66
65
break ;
66
+ default :
67
+ $ params ['order ' ] = 'starts_at ' ;
68
+ break ;
67
69
}
68
70
69
- switch ($ request ->input ('order_direction ' , 'asc ' )) {
71
+ switch ($ request ->input ('order_direction ' , 'desc ' )) {
70
72
case 'desc ' :
71
73
$ params ['order_direction ' ] = 'desc ' ;
72
74
break ;
73
75
case 'asc ' :
74
- default :
75
76
$ params ['order_direction ' ] = 'asc ' ;
77
+ break ;
78
+ default :
79
+ $ params ['order_direction ' ] = 'desc ' ;
76
80
}
77
81
78
82
$ query = $ query ->orderBy ($ params ['order ' ], $ params ['order_direction ' ]);
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ public function seatGroups(): HasMany
99
99
return $ this ->hasMany (SeatGroup::class);
100
100
}
101
101
102
+ public function isOld (): bool
103
+ {
104
+ return $ this ->ends_at < date ("Y-m-d H:i:s " );
105
+ }
106
+
102
107
public function getAvailableEventMappings (?EventMapping $ existing = null ): array
103
108
{
104
109
$ allProviders = TicketProvider::all ();
Original file line number Diff line number Diff line change 103
103
</thead >
104
104
<tbody >
105
105
@foreach ($events as $event )
106
+ @if ($event -> isOld () )
107
+ <tr class =" table-secondary" >
108
+ @else
106
109
<tr >
110
+ @endif
111
+
107
112
<td class =" text-muted" >{{ $event -> id } } </td >
108
113
<td >
109
114
<a href =" {{ route (' admin.events.show' , $event -> code ) } }" >{{ $event -> name } } </a >
124
129
</td >
125
130
</tr >
126
131
@endforeach
127
- </tbody >
128
- </table >
132
+ </tbody >
133
+ </table >
129
134
</div >
130
135
@include (' partials._pagination' , [
131
136
' page' => $events
You can’t perform that action at this time.
0 commit comments