File tree Expand file tree Collapse file tree
resources/views/admin/events Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,18 +61,22 @@ public function index(Request $request)
6161 $ params ['order ' ] = $ request ->input ('order ' );
6262 break ;
6363 case 'id ' :
64- default :
6564 $ params ['order ' ] = 'id ' ;
6665 break ;
66+ default :
67+ $ params ['order ' ] = 'starts_at ' ;
68+ break ;
6769 }
6870
69- switch ($ request ->input ('order_direction ' , 'asc ' )) {
71+ switch ($ request ->input ('order_direction ' , 'desc ' )) {
7072 case 'desc ' :
7173 $ params ['order_direction ' ] = 'desc ' ;
7274 break ;
7375 case 'asc ' :
74- default :
7576 $ params ['order_direction ' ] = 'asc ' ;
77+ break ;
78+ default :
79+ $ params ['order_direction ' ] = 'desc ' ;
7680 }
7781
7882 $ 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
9999 return $ this ->hasMany (SeatGroup::class);
100100 }
101101
102+ public function isOld (): bool
103+ {
104+ return $ this ->ends_at < date ("Y-m-d H:i:s " );
105+ }
106+
102107 public function getAvailableEventMappings (?EventMapping $ existing = null ): array
103108 {
104109 $ allProviders = TicketProvider::all ();
Original file line number Diff line number Diff line change 103103 </thead >
104104 <tbody >
105105 @foreach ($events as $event )
106+ @if ($event -> isOld () )
107+ <tr class =" table-secondary" >
108+ @else
106109 <tr >
110+ @endif
111+
107112 <td class =" text-muted" >{{ $event -> id } } </td >
108113 <td >
109114 <a href =" {{ route (' admin.events.show' , $event -> code ) } }" >{{ $event -> name } } </a >
124129 </td >
125130 </tr >
126131 @endforeach
127- </tbody >
128- </table >
132+ </tbody >
133+ </table >
129134 </div >
130135 @include (' partials._pagination' , [
131136 ' page' => $events
You can’t perform that action at this time.
0 commit comments