From 8519357d2613a870a56a4c1769b4da9069bb0db4 Mon Sep 17 00:00:00 2001 From: Momo Date: Wed, 4 Jul 2018 23:43:37 +0000 Subject: Revamp jam index, add winner team staff backend and user frontend --- templates/main/jams/index.html | 40 ++++--- templates/main/jams/team_list.html | 17 ++- templates/staff/jams/teams/view.html | 222 ++++++++++++++++++++++++++++------- 3 files changed, 219 insertions(+), 60 deletions(-) (limited to 'templates') diff --git a/templates/main/jams/index.html b/templates/main/jams/index.html index 9a228b74..3546bd71 100644 --- a/templates/main/jams/index.html +++ b/templates/main/jams/index.html @@ -58,7 +58,7 @@ {% if jams %} {% for jam in jams %} -

+

Code Jam {{ jam.number }}: {{ jam.title }} {% if jam.state == "announced" %} @@ -86,25 +86,29 @@ State: {{ jam.state.title() }}

- -

+

+
+

Start: {{ format_datetime(jam.date_start) }} UTC

+
+
+

End: {{ format_datetime(jam.date_end) }} UTC

+
{% if jam.participants %} - - Participants: {{ jam.participants | length }} - + {% if jam.winning_team %} + +

Participants: {{ jam.participants | length }}

+
+ +

Champions: {{ jam.winning_team.name }}

+
+ {% else %} + +

Participants: {{ jam.participants | length }}

+
+ {% endif %} {% endif %} - - {{ format_datetime(jam.date_start) }} UTC - - - - - - - - {{ format_datetime(jam.date_end) }} UTC - - +
+

{% if jam.state in ["running", "judging", "finished"] %} Theme: {{ jam.theme }} diff --git a/templates/main/jams/team_list.html b/templates/main/jams/team_list.html index 65d58f8a..75c48337 100644 --- a/templates/main/jams/team_list.html +++ b/templates/main/jams/team_list.html @@ -38,12 +38,25 @@

{% for team in teams %}
+ {% if not user_teams %} + {% if logged_in and user.user_id in member_ids(team.members) %} + + {% endif %} + {% if jam.winning_team and jam.winning_team == team.id %} + + {% endif %} + {% endif %} Team {{ team.name }} {% if user_teams %}
@@ -13,7 +14,7 @@