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 @@ -60,18 +60,22 @@ public function index(Request $request)
6060 $ params ['order ' ] = $ request ->input ('order ' );
6161 break ;
6262 case 'id ' :
63- default :
6463 $ params ['order ' ] = 'id ' ;
6564 break ;
65+ default :
66+ $ params ['order ' ] = 'starts_at ' ;
67+ break ;
6668 }
6769
68- switch ($ request ->input ('order_direction ' , 'asc ' )) {
70+ switch ($ request ->input ('order_direction ' , 'desc ' )) {
6971 case 'desc ' :
7072 $ params ['order_direction ' ] = 'desc ' ;
7173 break ;
7274 case 'asc ' :
73- default :
7475 $ params ['order_direction ' ] = 'asc ' ;
76+ break ;
77+ default :
78+ $ params ['order_direction ' ] = 'desc ' ;
7579 }
7680
7781 $ 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
9292 return $ this ->hasMany (SeatGroup::class);
9393 }
9494
95+ public function isOld (): bool
96+ {
97+ return $ this ->ends_at < date ("Y-m-d H:i:s " );
98+ }
99+
95100 public function getAvailableEventMappings (?EventMapping $ existing = null ): array
96101 {
97102 $ 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