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 @@ -60,18 +60,22 @@ public function index(Request $request)
60
60
$ params ['order ' ] = $ request ->input ('order ' );
61
61
break ;
62
62
case 'id ' :
63
- default :
64
63
$ params ['order ' ] = 'id ' ;
65
64
break ;
65
+ default :
66
+ $ params ['order ' ] = 'starts_at ' ;
67
+ break ;
66
68
}
67
69
68
- switch ($ request ->input ('order_direction ' , 'asc ' )) {
70
+ switch ($ request ->input ('order_direction ' , 'desc ' )) {
69
71
case 'desc ' :
70
72
$ params ['order_direction ' ] = 'desc ' ;
71
73
break ;
72
74
case 'asc ' :
73
- default :
74
75
$ params ['order_direction ' ] = 'asc ' ;
76
+ break ;
77
+ default :
78
+ $ params ['order_direction ' ] = 'desc ' ;
75
79
}
76
80
77
81
$ query = $ query ->orderBy ($ params ['order ' ], $ params ['order_direction ' ]);
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ public function seatGroups(): HasMany
92
92
return $ this ->hasMany (SeatGroup::class);
93
93
}
94
94
95
+ public function isOld (): bool
96
+ {
97
+ return $ this ->ends_at < date ("Y-m-d H:i:s " );
98
+ }
99
+
95
100
public function getAvailableEventMappings (?EventMapping $ existing = null ): array
96
101
{
97
102
$ 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