Reverse order of upcoming and current conferences on dashboard
authorMagnus Hagander <magnus@hagander.net>
Wed, 12 Sep 2018 20:33:59 +0000 (22:33 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 12 Sep 2018 20:33:59 +0000 (22:33 +0200)
Show the next upcoming one first, instead of ordering them
last-to-first. This makes more sense for current/upcoming, since the one
most likely to be worked on is then at the first position.

Past conferences remain sorted the same way as before, since that leaves
the most recent one first.

Suggsted by Andreas Scherbaum, though not his patch since it didn't
work.

postgresqleu/confreg/views.py

index 1638780e671bffa29a0a83b680e13b18687bb4fb..e80fb11e47fe3701d06ada45be00a9fcfa9d6a15 100644 (file)
@@ -2468,9 +2468,9 @@ def admin_dashboard(request):
        past = []
        for c in conferences:
                if abs((date.today() - c.startdate).days) < 14 or abs((date.today() - c.enddate).days)  < 14:
-                       current.append(c)
+                       current.insert(0, c)
                elif c.startdate > date.today():
-                       upcoming.append(c)
+                       upcoming.insert(0, c)
                else:
                        past.append(c)