Files
sport-prog-club/app/templates/teacher/assignment.html
T
Кирилл ЯценкоandClaude Opus 5 cc0abcc22e Визуальный язык клуба, объявления, OIDC и уведомления
Дизайн
- Плакатный язык: жёлтое поле, чёрные линейки, тяжёлый гротеск, три цвета.
  Сложность и статусы кодируются плотностью заливки, а не цветом.
- Навигация вынесена в вертикальную рейку, на телефоне — нижняя панель вкладок.
- Переключатель темы (светлая по умолчанию → тёмная → как в системе),
  выбор хранится в браузере и применяется до первой отрисовки.
- Эмблема клуба: герб МГУ в фигурных скобках; шрифты Unbounded, Golos Text
  и JetBrains Mono лежат в репозитории (OFL), ни одного запроса к CDN.

Функциональность
- Объявления с обратным отсчётом до старта соревнования и ссылкой на него;
  строка ближайшего события видна с любой страницы.
- Вход через OpenID Connect (Authentik) с маппингом групп на роль преподавателя.
- Один участник — несколько способов входа: Telegram и OIDC привязываются
  к существующей учётке из кабинета, последний способ отвязать нельзя.
- Уведомления в Telegram: объявления, выданные задания, напоминания о старте.
- Профиль переработан: баллы и место, прогресс по заданиям, последние решения,
  календарь активности с выравниванием по неделям, кнопка «Обновить результаты».

Прочее
- Первый вошедший становится преподавателем — иначе портал запирался.
- Приложение отказывается стартовать с дефолтным SECRET_KEY.
- Команды `backup` и `gen-secret`, CI для Gitea и GitHub.
- Тексты интерфейса сокращены, тестов стало 133.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:39:19 +03:00

90 lines
3.8 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 %}
<h1>{{ assignment.title }}</h1>
<p class="sub">
{{ assignment.group.title if assignment.group else "персональное" }} ·
выдано {{ assignment.assigned_at | dt }}
{% if assignment.deadline %} · дедлайн {{ assignment.deadline | dt }}{% endif %}
</p>
{% if progress.participants %}
<div class="card table-wrap" style="padding:6px">
<table class="matrix">
<thead>
<tr>
<th>Студент</th>
{% for problem in progress.problems %}
<th><a href="{{ problem.url }}" target="_blank" rel="noopener"
title="{{ problem.title }}">{{ loop.index }}</a></th>
{% endfor %}
<th>Итого</th>
</tr>
</thead>
<tbody>
{% for student in progress.participants %}
<tr>
<td>
<span class="row" style="gap:9px; flex-wrap:nowrap">
<span class="avatar sm" style="--h: {{ student.display_name | hue }}">{{ student.display_name | initials }}</span>
<a href="/u/{{ student.id }}">{{ student.display_name }}</a>
</span>
</td>
{% for problem in progress.problems %}
{% set cell = progress.cell(student.id, problem.id) %}
<td><span class="cell {{ cell.status.value }}"
title="{{ problem.title }} — {{ cell.solved_at | dt if cell.solved_at else 'не решено' }}">
{% if cell.counts %}{{ icon("check") }}{% elif cell.status == SolveStatus.solved_before %}•{% endif %}
</span></td>
{% endfor %}
<td class="num"><strong>{{ progress.solved_count(student.id) }}/{{ progress.total_problems }}</strong></td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td class="small muted">Решили</td>
{% for problem in progress.problems %}
<td class="small muted num">{{ progress.problem_solved_count(problem.id) }}</td>
{% endfor %}
<td></td>
</tr>
</tfoot>
</table>
</div>
<div class="legend">
<span class="item"><span class="cell solved_in_time">{{ icon("check") }}</span> в срок</span>
<span class="item"><span class="cell solved_late">{{ icon("check") }}</span> после дедлайна</span>
<span class="item"><span class="cell solved_before">•</span> решено до выдачи, не засчитано</span>
</div>
{% else %}
<div class="card">{{ empty("users", "В группе нет студентов — раздай код группы.",
"/teacher/groups", "К группам") }}</div>
{% endif %}
<h2>{{ icon("layers") }} Задачи</h2>
<div class="card table-wrap" style="padding:6px">
<table>
<thead><tr><th>#</th><th>Задача</th><th>Платформа</th><th>Сложность</th><th>Решили</th></tr></thead>
<tbody>
{% for problem in progress.problems %}
{% set solved = progress.problem_solved_count(problem.id) %}
<tr>
<td class="muted num">{{ loop.index }}</td>
<td><a href="{{ problem.url }}" target="_blank" rel="noopener">{{ problem.title }} {{ icon("external") }}</a></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 %}—{% endif %}</td>
<td class="num">
{{ solved }} / {{ progress.participants | length }}
{% if progress.participants and solved == 0 %}<span class="badge bad">{{ icon("alert") }} никто</span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}