From b7ea5278a3794dca2b915d10fa6ab96ab2ac7731 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 8 Aug 2019 17:34:43 -0300 Subject: [PATCH 1/4] Style hackathon list --- .../templates/dashboard/hackathons.html | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/dashboard/templates/dashboard/hackathons.html b/app/dashboard/templates/dashboard/hackathons.html index a5f2cf2711a..a150a039953 100644 --- a/app/dashboard/templates/dashboard/hackathons.html +++ b/app/dashboard/templates/dashboard/hackathons.html @@ -43,13 +43,22 @@
{% for hackathon in hackathons %} -
-
- {% if hackathon.logo_svg %} - - {% elif hackathon.logo %} - + +
+
+ {% firstof firstof hackathon.logo_svg or hackathon.logo as logo %} + {% if logo %} + + {% else %} +
+ No Image +
{% endif %} +
{{ hackathon.name }}
From 23734545ddbb8a12f2b76dee2e17fe4e3c2dd2a1 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 8 Aug 2019 17:43:09 -0300 Subject: [PATCH 2/4] change no logo to title --- app/dashboard/templates/dashboard/hackathons.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/dashboard/templates/dashboard/hackathons.html b/app/dashboard/templates/dashboard/hackathons.html index a150a039953..3a2c912d4e8 100644 --- a/app/dashboard/templates/dashboard/hackathons.html +++ b/app/dashboard/templates/dashboard/hackathons.html @@ -52,13 +52,12 @@
{% firstof firstof hackathon.logo_svg or hackathon.logo as logo %} {% if logo %} - + {% else %} -
- No Image -
+
+ {{ hackathon.name }} +
{% endif %} -
{{ hackathon.name }}
From 5a3fe17364ed8e0c17ac02bc8ab8dfd8f1a659df Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 8 Aug 2019 17:48:31 -0300 Subject: [PATCH 3/4] add vertical space --- app/dashboard/templates/dashboard/hackathons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dashboard/templates/dashboard/hackathons.html b/app/dashboard/templates/dashboard/hackathons.html index 3a2c912d4e8..f1880d39c1b 100644 --- a/app/dashboard/templates/dashboard/hackathons.html +++ b/app/dashboard/templates/dashboard/hackathons.html @@ -49,7 +49,7 @@ }
-
+
{% firstof firstof hackathon.logo_svg or hackathon.logo as logo %} {% if logo %} From 761379977b92bfe18d7ba097c90ae7f606ddd54b Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 8 Aug 2019 18:00:39 -0300 Subject: [PATCH 4/4] add order by last created --- app/dashboard/templates/dashboard/hackathons.html | 2 +- app/dashboard/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/dashboard/templates/dashboard/hackathons.html b/app/dashboard/templates/dashboard/hackathons.html index f1880d39c1b..0a2b301cf7c 100644 --- a/app/dashboard/templates/dashboard/hackathons.html +++ b/app/dashboard/templates/dashboard/hackathons.html @@ -50,7 +50,7 @@
- {% firstof firstof hackathon.logo_svg or hackathon.logo as logo %} + {% firstof hackathon.logo_svg or hackathon.logo as logo %} {% if logo %} {% else %} diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 25093f3e907..1014ec23d64 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -2852,7 +2852,7 @@ def get_hackathons(request): """Handle rendering all Hackathons.""" try: - events = HackathonEvent.objects.values() + events = HackathonEvent.objects.values().order_by('-created_on') except HackathonEvent.DoesNotExist: raise Http404