Files
sport-prog-club/app/templates/assignment.html
T
Кирилл ЯценкоandClaude Opus 5 264e4f5c46
Выкатка / deploy (push) Successful in 2m16s
Формулировки короче, плюс испанский и немецкий
Двадцать семь строк интерфейса объясняли, почему портал устроен так, а не
иначе: «иначе рейтинг поехал бы задним числом», «складывать их портал
не берётся». Студенту и преподавателю нужно правило, а не его обоснование —
обоснование осталось в комментариях кода, где ему и место.

Языков стало пять: добавлены испанский и немецкий, все 911 строк переведены
целиком. Обращение на «ты», как и в русском.

Проверки языка в тестах брали немецкий как пример незнакомого — теперь
незнакомый там итальянский, а немецкий и испанский проверяются как рабочие.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-25 01:28:55 +05:00

106 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% from "_ui.html" import empty %}
{% block title %}{{ assignment.title }} — {{ settings.app_name }}{% endblock %}
{% block content %}
{% set solved = progress.solved_count(user.id) %}
<h1>{{ assignment.title }}</h1>
<p class="sub">
{{ _("Выдано") }} {{ assignment.assigned_at | dt }}
{% if assignment.deadline %}
· {{ _("дедлайн") }} {{ assignment.deadline | dt }}
{% endif %}
{% if assignment.group %} · {{ assignment.group.title }}{% endif %}
</p>
<div class="card">
<div class="bar {{ 'done' if progress.total_problems and solved == progress.total_problems }}">
<span style="width: {{ (100 * solved / progress.total_problems) if progress.total_problems else 0 }}%"></span>
</div>
<div class="progress-line">
<span>{{ (_("Решено <b>%(solved)s</b> из <b>%(total)s</b>") % {"solved": solved, "total": progress.total_problems}) | safe }}</span>
<span>{{ ((100 * solved / progress.total_problems) | round | int) if progress.total_problems else 0 }}%</span>
</div>
</div>
{% if assignment.requires_solution %}
<div class="card callout">
<h3>{{ icon("shield") }} {{ _("К задачам нужно прислать код") }}</h3>
<p class="small" style="margin:0">
{{ _("Кроме посылки на платформе пришли сам код — текстом, прямо на портале.") }}
{{ _("Без кода зачёта нет, даже если задача решена на площадке. Отклонённый код снимает зачёт; прислать можно заново.") }}
</p>
</div>
{% endif %}
{% if problems %}
<div class="card table-wrap" style="padding:6px">
<table>
<thead>
<tr><th>#</th><th>{{ _("Задача") }}</th><th>{{ _("Платформа") }}</th><th>{{ _("Сложность") }}</th>
<th>{{ _("Статус") }}</th><th>{{ _("Когда") }}</th>
{% if assignment.requires_solution %}<th>{{ _("Код") }}</th>{% endif %}
<th>{{ _("Первым") }}</th></tr>
</thead>
<tbody>
{% for problem in problems %}
{% set cell = progress.cell(user.id, problem.id) %}
<tr>
<td class="muted num">{{ loop.index }}</td>
<td>{{ problem_link(problem) }}</td>
<td class="small muted">{{ problem.platform.title }} · {{ problem.label }}</td>
<td>
{% if problem.difficulty %}<span class="badge {{ problem.difficulty | lower }}">{{ problem.difficulty }}</span>
{% elif problem.rating %}<span class="badge rating">{{ problem.rating }}</span>
{% else %}<span class="muted">—</span>{% endif %}
</td>
<td>
{% if cell.status == SolveStatus.solved_in_time %}<span class="badge ok">{{ icon("check") }} {{ _("решено") }}</span>
{% elif cell.status == SolveStatus.solved_late %}<span class="badge warn">{{ icon("clock") }} {{ _("после дедлайна, не засчитано") }}</span>
{% elif cell.status == SolveStatus.solved_before %}<span class="badge">{{ _("решено до выдачи") }}</span>
{% else %}<span class="muted">—</span>{% endif %}
</td>
<td class="small muted">
{% if cell.solved_at %}{{ cell.solved_at | ago }}
{% elif cell.first_ever_at %}{{ cell.first_ever_at | ago }}
{% else %}—{% endif %}
</td>
{% if assignment.requires_solution %}
{% set mine = my_solutions.get(problem.id) %}
<td class="small">
{% if mine %}
{% if mine.status.value == "accepted" %}
<a class="badge ok" href="/solutions/{{ mine.id }}">{{ icon("check") }} {{ _("принято") }}</a>
{% elif mine.status.value == "rejected" %}
<a class="badge err" href="/solutions/{{ mine.id }}">{{ icon("alert") }} {{ _("отклонено") }}</a>
{% else %}
<a class="badge warn" href="/solutions/{{ mine.id }}">{{ icon("clock") }} {{ _("на проверке") }}</a>
{% endif %}
<br>
{% endif %}
<a class="btn ghost small" href="/assignments/{{ assignment.id }}/solutions/{{ problem.id }}">
{{ icon("edit") }} {{ _("Заменить") if mine else _("Прислать код") }}
</a>
</td>
{% endif %}
<td class="small">
{% set first = progress.first_solver(problem.id) %}
{% if first %}<a class="badge first" href="/u/{{ first.id }}">{{ icon("flame") }}{{ first.display_name }}</a>
{% else %}<span class="muted">—</span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="card">{{ empty("inbox", _("В этом задании ещё нет задач.")) }}</div>
{% endif %}
<p class="small muted">
{{ _("В зачёт идёт решённое после выдачи и до дедлайна.") }}
{% if assignment.count_prior_solves %}{{ _("Решённое до выдачи тоже засчитывается.") }}
{% else %}{{ _("Решённое до выдачи не засчитывается.") }}{% endif %}
{{ _("После дедлайна решение видно, но в счёт не идёт.") }}
</p>
{% endblock %}