NDOJ/templates/problem/list.html

180 lines
8.8 KiB
HTML
Raw Normal View History

2022-05-28 04:28:22 +00:00
{% extends "problem/list-base.html" %}
2022-04-13 05:52:03 +00:00
{% block left_sidebar %}
2022-05-28 04:28:22 +00:00
{% include "problem/left-sidebar.html" %}
2022-04-13 05:52:03 +00:00
{% endblock %}
2020-01-21 06:35:58 +00:00
2022-12-29 06:20:50 +00:00
{% set in_ioi16 = request.in_contest_mode and request.participation.contest.format_name == "ioi16" %}
2022-04-13 05:52:03 +00:00
{% block middle_content %}
2022-05-28 04:28:22 +00:00
<div id="content-left" class="problems">
<table id="problem-table" class="table striped">
<thead>
<tr>
{% if request.in_contest_mode %}
2022-12-29 06:20:50 +00:00
{% if request.user.is_authenticated and not in_ioi16 %}
2022-05-28 04:28:22 +00:00
<th class="solved"><i class="fa fa-check"></i></th>
{% endif %}
<th class="problem">{{ _('Problem') }}</th>
<th class="pcode">{{ _('Problem code') }}</th>
{% if show_types %}
<th>{{ _('Types') }}</th>
{% endif %}
<th class="points">{{ _('Points') }}</th>
2022-12-29 06:20:50 +00:00
{% if not in_ioi16 %}
2022-05-28 04:28:22 +00:00
<th class="users">{{ _('Users') }}</th>
2022-12-29 06:20:50 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
{% else %}
{% if request.user.is_authenticated %}
<th class="solved">
<a href="{{ sort_links.solved }}"><i class="fa fa-check"></i>{{ sort_order.solved }}
</a>
2020-01-21 06:35:58 +00:00
</th>
2022-05-28 04:28:22 +00:00
{% endif %}
<th class="problem">
<a href="{{ sort_links.name }}">{{ _('Problem') }}{{ sort_order.name }}</a>
</th>
<th class="pcode">
<a href="{{ sort_links.code }}">{{ _('Problem code') }}</a>
</th>
2022-06-05 17:05:25 +00:00
<th class="category">
<a href="{{ sort_links.group }}">{{ _('Category') }}{{ sort_order.group }}</a>
</th>
2022-05-28 04:28:22 +00:00
{% if show_types %}
<th>
<a href="{{ sort_links.type }}">{{ _('Types') }}{{ sort_order.type }}</a>
2020-06-15 18:46:43 +00:00
</th>
2020-01-21 06:35:58 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
<th class="points">
<a href="{{ sort_links.points }}">{{ _('Points') }}{{ sort_order.points }}</a>
</th>
<th class="ac-rate">
<a href="{{ sort_links.ac_rate }}">{{ _('AC %%') }}{{ sort_order.ac_rate }}</a>
</th>
<th class="users">
2022-06-05 16:53:44 +00:00
<a href="{{ sort_links.user_count }}">{{ _('AC #') }}{{ sort_order.user_count }}</a>
2022-05-28 04:28:22 +00:00
</th>
{% if show_editorial %}
<th class="editorial">
{{_('Editorial')}}
</th>
{% endif %}
{% endif %}
</tr>
</thead>
<tbody>
{% for problem in object_list %}
<tr>
2022-12-29 06:20:50 +00:00
{% if request.user.is_authenticated and not in_ioi16 %}
2022-05-28 04:28:22 +00:00
{% if problem.id in completed_problem_ids %}
<td solved="1">
<a href="{{ url('user_submissions', problem.code, request.user.username) }}">
2022-01-10 11:13:46 +00:00
{% if problem.is_public or request.in_contest_mode %}
2022-05-28 04:28:22 +00:00
<i class="solved-problem-color fa fa-check-circle"></i>
2020-01-21 06:35:58 +00:00
{% else %}
2022-05-28 04:28:22 +00:00
<i class="solved-problem-color fa fa-lock"></i>
2020-01-21 06:35:58 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
</a>
2020-01-21 06:35:58 +00:00
</td>
2022-05-28 04:28:22 +00:00
{% elif problem.id in attempted_problems %}
<td solved="0">
<a href="{{ url('user_submissions', problem.code, request.user.username) }}">
{% if problem.is_public or request.in_contest_mode %}
<i class="attempted-problem-color fa fa-minus-circle"></i>
{% else %}
<i class="attempted-problem-color fa fa-lock"></i>
{% endif %}
</a>
</td>
{% else %}
<td solved="-1">
{% if problem.is_public or request.in_contest_mode %}
<i class="unsolved-problem-color fa fa-minus-circle"></i>
2020-01-21 06:35:58 +00:00
{% else %}
2022-05-28 04:28:22 +00:00
<i class="unsolved-problem-color fa fa-lock"></i>
2020-01-21 06:35:58 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
</td>
{% endif %}
{% endif %}
<td class="problem">
<a href="{{ url('problem_detail', problem.code) }}">{{ problem.i18n_name }}</a>
</td>
<td class="pcode">
<a class="pcodecell" href="{{ url('problem_detail', problem.code) }}">{{ problem.code }}</a>
</td>
2022-06-05 17:05:25 +00:00
{% if not request.in_contest_mode %}
<td class="category">{{ problem.group.full_name }}</td>
{% endif %}
2022-05-28 04:28:22 +00:00
{% if show_types %}
<td class="types">
{% for type in problem.types_list %}
<span class="type-tag">{{ type }}</span>{% if not loop.last %}, {% endif %}
{% endfor %}
2020-01-21 06:35:58 +00:00
</td>
2022-05-28 04:28:22 +00:00
{% endif %}
<td class="p">{{ problem.points|floatformat }}{% if problem.partial %}p{% endif %}</td>
{% if not request.in_contest_mode %}
2022-06-05 16:53:44 +00:00
<td class="ac-rate">{{ problem.ac_rate|floatformat(0) }}%</td>
2022-05-28 04:28:22 +00:00
{% endif %}
2022-12-29 06:20:50 +00:00
{% if not in_ioi16 %}
2022-05-28 04:28:22 +00:00
<td class="users">
<a href="{{ url('ranked_submissions', problem.code) }}">
{% if not request.in_contest_mode or not hide_contest_scoreboard %}
{{ problem.user_count }}
{% else %}
???
2020-06-15 18:46:43 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
</a>
</td>
2022-12-29 06:20:50 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
{% if show_editorial%}
<td class="editorial">
{% if problem.has_public_editorial %}
<a href="{{ url('problem_editorial', problem.code) }}">{{ _('Editorial') }}</a>
2020-06-15 18:46:43 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if request.in_contest_mode and request.participation.contest.use_clarifications %}
<br><br>
{% if can_edit_contest %}
<div style="float: right; font-size: 1.2em">
2022-12-18 09:31:31 +00:00
<a href="{{url('new_contest_clarification', request.participation.contest.key)}}"><i class="fa fa-plus-circle" class="green"></i> <u>{{_('Add clarifications')}}</u></a>
2022-05-28 04:28:22 +00:00
</div>
{% endif %}
{% if has_clarifications %}
<div style="font-size: 1.2em; font-style: bold">
<i class="fa fa-question-circle"></i> {{_('Clarifications')}}</div>
<table class="table">
<tr>
<th>{{_('Problem')}}</th>
<th>{{_('Time')}}</th>
<th>{{_('Description')}}</th>
2020-01-21 06:35:58 +00:00
</tr>
2022-05-28 04:28:22 +00:00
{% for clarification in clarifications %}
2021-10-19 22:41:53 +00:00
<tr>
2022-05-28 04:28:22 +00:00
<td>
<a href="{{ url('problem_detail', clarification.problem.problem.code) }}"
2022-05-28 04:28:22 +00:00
class="problem">
{{ clarification.problem.problem.name }}
2022-05-28 04:28:22 +00:00
</a>
</td>
<td class="time">{{ relative_time(clarification.date) }}</td>
<td><p style="overflow-wrap: break-word; word-break: break-word">{{clarification.description}}</p></td>
2021-10-19 22:41:53 +00:00
</tr>
2022-05-28 04:28:22 +00:00
{% endfor %}
</table>
{% else %}
<p style="font-style: italic; text-align: center">
{{ _('No clarifications have been made at this time.') }}</center>
</p>
2021-10-19 22:41:53 +00:00
{% endif %}
2022-05-28 04:28:22 +00:00
{% endif %}
</div>
2022-04-13 05:52:03 +00:00
{% if page_obj.num_pages > 1 %}
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
{% endif %}
{% endblock %}