Skip to content

Commit 1a5fdda

Browse files
author
spidey789
committed
added is_contest_complete function and updated teams.html printing of teams by adding conditionals
1 parent 0513e46 commit 1a5fdda

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

src/core/templates/core/teams.html

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,19 @@ <h2>Upper Division</h2>
3737
{% for team in upper_teams %}
3838
<tr>
3939
<td>
40-
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
41-
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
40+
{% if forloop.counter == 1 and contest.is_contest_complete %}
41+
<span class="d-block d-md-none ml-1">🥇{{ team.name }}</span>
42+
<span class="d-none d-md-block ml-3">🥇{{ team.name }}</span>
43+
{% elif forloop.counter == 2 and contest.is_contest_complete %}
44+
<span class="d-block d-md-none ml-1">🥈{{ team.name }}</span>
45+
<span class="d-none d-md-block ml-3">🥈{{ team.name }}</span>
46+
{% elif forloop.counter == 3 and contest.is_contest_complete %}
47+
<span class="d-block d-md-none ml-1">🥉{{ team.name }}</span>
48+
<span class="d-none d-md-block ml-3">🥉{{ team.name }}</span>
49+
{% else %}
50+
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
51+
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
52+
{% endif %}
4253
</td>
4354
<td class="text-center">{{ team.questions_answered }}</td>
4455
<td class="text-center">{{ team.score }}</td>
@@ -99,8 +110,19 @@ <h2>Lower Division</h2>
99110
{% for team in lower_teams %}
100111
<tr>
101112
<td>
102-
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
103-
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
113+
{% if forloop.counter == 1 and contest.is_contest_complete %}
114+
<span class="d-block d-md-none ml-1">🥇{{ team.name }}</span>
115+
<span class="d-none d-md-block ml-3">🥇{{ team.name }}</span>
116+
{% elif forloop.counter == 2 and contest.is_contest_complete %}
117+
<span class="d-block d-md-none ml-1">🥈{{ team.name }}</span>
118+
<span class="d-none d-md-block ml-3">🥈{{ team.name }}</span>
119+
{% elif forloop.counter == 3 and contest.is_contest_complete %}
120+
<span class="d-block d-md-none ml-1">🥉{{ team.name }}</span>
121+
<span class="d-none d-md-block ml-3">🥉{{ team.name }}</span>
122+
{% else %}
123+
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
124+
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
125+
{% endif %}
104126
</td>
105127
<td class="text-center">{{ team.questions_answered }}</td>
106128
<td class="text-center">{{ team.score }}</td>
@@ -161,8 +183,19 @@ <h2>Faculty</h2>
161183
{% for team in faculty_teams %}
162184
<tr>
163185
<td>
164-
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
165-
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
186+
{% if forloop.counter == 1 and contest.is_contest_complete %}
187+
<span class="d-block d-md-none ml-1">🥇{{ team.name }}</span>
188+
<span class="d-none d-md-block ml-3">🥇{{ team.name }}</span>
189+
{% elif forloop.counter == 2 and contest.is_contest_complete %}
190+
<span class="d-block d-md-none ml-1">🥈{{ team.name }}</span>
191+
<span class="d-none d-md-block ml-3">🥈{{ team.name }}</span>
192+
{% elif forloop.counter == 3 and contest.is_contest_complete %}
193+
<span class="d-block d-md-none ml-1">🥉{{ team.name }}</span>
194+
<span class="d-none d-md-block ml-3">🥉{{ team.name }}</span>
195+
{% else %}
196+
<span class="d-block d-md-none ml-1">{{ team.name }}</span>
197+
<span class="d-none d-md-block ml-3">{{ team.name }}</span>
198+
{% endif %}
166199
</td>
167200
<td class="text-center">{{ team.questions_answered }}</td>
168201
<td class="text-center">{{ team.score }}</td>

0 commit comments

Comments
 (0)