Add new ui for active-contest

This commit is contained in:
HungBacktracking 2023-09-08 17:44:07 +07:00
parent 79e86c7a4a
commit e6fb05a6c8

View file

@ -233,45 +233,45 @@
{{ _('Active Contests') }}
</h3>
<div class="toggled">
<table class="contest-list table striped">
<thead>
<tr>
<th style="width:90%">{{ _('Contest') }}</th>
<th>{{ _('Users') }}</th>
{% if not request.in_contest %}
<th style="width:15%"></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for participation in active_participations %}
{% with contest=participation.contest %}
<tr>
<td>
<div class="contest-block">
{{ contest_head(contest) }}
{% if contest.start_time %}
<br>
{% if contest.time_limit %}
<span class="time">
{% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %}
</span>
{% elif contest.time_before_end %}
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
{% endif %}
{{ time_left(contest) }}
{% endif %}
</div>
</td>
<td>
{{ user_count(contest, request.user) }}
</td>
{{ contest_join(contest, request) }}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% for participation in active_participations %}
{% with contest=participation.contest %}
<div class="list-contest">
<div class="info-contest" style="flex: 1.5">
<div class="contest-title">Kì thi:</div>
{{ contest_head(contest) }}
</div>
<div class="info-contest" style="flex: 1.5">
<div class="contest-title">Thời gian:</div>
<div class="contest-block">
{% if contest.start_time %}
{% if contest.time_limit %}
<span class="time">
{% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %}
</span>
{% elif contest.time_before_end %}
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
{% endif %}
{{ time_left(contest) }}
{% endif %}
</div>
</div>
<div class="info-contest">
<div class="contest-title">Định dạng:</div>
{% if contest.format_name == "default" %} IOI
{% else %} {{ contest.format_name|upper }}
{% endif %}
</div>
<div class="info-contest">
<div class="contest-title">Người tham gia:</div>
{{ user_count(contest, request.user) }}
</div>
<div class="participate-button">
{{ contest_join(contest, request) }}
</div>
</div>
{% endwith %}
{% endfor %}
</div>
<br>
{% endif %}