Skip to content

Commit

Permalink
ballon color
Browse files Browse the repository at this point in the history
  • Loading branch information
leduythuccs committed Dec 13, 2024
1 parent 66684dd commit 30f3726
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions judge/views/contests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,21 @@ def get_context_data(self, **kwargs):
context = super(ContestBalloons, self).get_context_data(**kwargs)
context['balloons_done'] = max(0, int(self.request.GET.get('balloons_done', 0)) - 1)
context['accept_submissions'] = self.get_accepted_submissions()[context['balloons_done']:]
context['color_map'] = {
'icpc_g': 'đỏ',
'icpc_c': 'xanh dương',
'icpc_f': 'xanh ngọc ',
'icpc_b': 'xanh lá nhạt',
'icpc_d': 'tím',
'icpc_l': 'hồng đậm',
'icpc_k': 'vàng',
'icpc_j': 'hồng nhạt',
'icpc_m': 'đen',
'icpc_i': 'xanh lá đậm',
'icpc_h': 'cam',
'icpc_a': 'xanh dương nhạt',
'icpc_e': 'xanh dương nhạt',
}
return context

def dispatch(self, request, *args, **kwargs):
Expand Down
13 changes: 13 additions & 0 deletions templates/contest/balloons.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
$('tr').click(mark_row);
$('#scroll-to-unmarked').click(scroll_to_unmarked);
});

// reload each 30 secs
setInterval(function() {
location.reload();
}, 30000);
</script>
{% endblock %}

Expand All @@ -100,6 +105,7 @@
<th>{{ _('SubID.') }}</th>
<th>{{ _('TEAM') }}</th>
<th>{{ _('PROBLEM') }}</th>
<th>{{ _('COLOR') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -116,6 +122,13 @@
<td style="text-align: left; padding-left: 2em;">
{{ submission.problem.code }}
</td>
<td style="text-align: left; padding-left: 2em;">
{% if submission.problem.code in color_map %}
{{ color_map[submission.problem.code] }}
{% else %}
Unknown
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 30f3726

Please sign in to comment.