From: Magnus Hagander Date: Wed, 12 Sep 2018 20:33:59 +0000 (+0200) Subject: Reverse order of upcoming and current conferences on dashboard X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpgdulink%28?a=commitdiff_plain;h=5d1053e89d904621034a3bed975d9bc5ede804fa;p=pgeu-website.git Reverse order of upcoming and current conferences on dashboard 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. --- diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py index 1638780..e80fb11 100644 --- a/postgresqleu/confreg/views.py +++ b/postgresqleu/confreg/views.py @@ -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)