Files
sport-prog-club/app/templates/materials.html
T
Кирилл ЯценкоandClaude Opus 5.5 43e7dc82ed
Выкатка / deploy (push) Successful in 10s
Соревнования: команды, старт по кнопке, табло ICPC и IOI
Отдельный раздел /contest на том же движке: своя рейка, часы тура вместо
строки события и свой знак — «>_» в угловых скобках. Посылки тура живут
в contest_runs, а не в submissions, чтобы задача с соревнования не
закрывала домашку и не всплывала в ленте. Общие с учёбой — только задачи
портала и судья.

- Команды: капитан заводит и раздаёт код, остальные входят по коду или
  ссылке; личное соревнование — команды из одного.
- Задачи открывает кнопка «Старт» на пульте, до неё их нет ни в разделе,
  ни по /tasks/…; дальше «+минуты» и «Завершить».
- Табло ICPC (штраф 20 минут, ошибка компиляции не штрафуется) и IOI
  (лучший результат по задаче), заморозка под конец, дорешивание после.
- MCP для преподавателя: создать, настроить, открыть регистрацию,
  стартовать, продлить, завершить, табло.
- Раздел закрыт студентам по умолчанию и открывается в «Видимости
  разделов».

Пунктир — общий знак «студенту этого не видно»: пункты рейки закрытых
разделов, полоса над закрытой страницей, задания до начала, кнопки и формы
преподавателя на общих страницах. Пустые заглушки стали сплошными, чтобы
пунктир значил одно.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:35:07 +05:00

80 lines
3.6 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 %}{{ _("Материалы") }} — {{ settings.app_name }}{% endblock %}
{% block content %}
<div class="page-head">
<div>
<p class="eyebrow">{{ _("библиотека") }}</p>
<h1>{{ _("Материалы") }}</h1>
<p class="sub">{{ _("Ноутбуки с семинаров, конспекты и разборы.") }}</p>
</div>
</div>
{% if teacher_view %}
<details class="formula staff-box" style="margin-bottom:18px" {% if not items %}open{% endif %}>
<summary>{{ icon("plus") }} {{ _("Опубликовать материал") }}</summary>
<form method="post" action="/materials" enctype="multipart/form-data" style="margin-top:12px">
<div class="grid two">
<div class="field">
<label for="file">{{ _("Файл") }}</label>
<input type="file" id="file" name="file" required>
</div>
<div class="field">
<label for="title">{{ _("Название (пусто — имя файла)") }}</label>
<input type="text" id="title" name="title" placeholder="{{ _("Семинар 3. Сортировки") }}">
</div>
<div class="field">
<label for="group_id">{{ _("Кому") }}</label>
<select id="group_id" name="group_id">
<option value="">{{ _("Всем") }}</option>
{% for group in groups %}<option value="{{ group.id }}">{{ group.title }}</option>{% endfor %}
</select>
</div>
<div class="field">
<label for="description">{{ _("Описание (необязательно)") }}</label>
<input type="text" id="description" name="description" placeholder="{{ _("Разбор задач 1–4") }}">
</div>
</div>
<p class="small muted">{{ _("До %(mb)s МБ.") % {"mb": max_mb} }} {{ _("Форматы:") }} {{ extensions }}.</p>
<button type="submit">{{ icon("send") }} {{ _("Опубликовать") }}</button>
</form>
</details>
{% endif %}
{% if items %}
<div class="grid two">
{% for item in items %}
<div class="card material">
<div class="row between" style="align-items:flex-start; gap:10px">
<h3 style="margin:0">{{ icon("book") }} {{ item.title }}</h3>
<span class="badge">{{ item.group.title if item.group else _("всем") }}</span>
</div>
{% if item.description %}<p class="small" style="margin:8px 0 0">{{ item.description }}</p>{% endif %}
<p class="small muted" style="margin:8px 0 0">
{{ item.filename }} · {{ item.size_label }} · {{ item.published_at | ago }}
</p>
<div class="row" style="margin-top:12px; gap:8px">
{% if item.can_preview %}
<a class="btn small" href="/materials/{{ item.id }}/view">{{ icon("book") }} {{ _("Смотреть") }}</a>
<a class="btn ghost small" href="/materials/{{ item.id }}/download">{{ icon("download") }} {{ _("Скачать") }}</a>
{% else %}
<a class="btn small" href="/materials/{{ item.id }}/download">{{ icon("download") }} {{ _("Скачать") }}</a>
{% endif %}
{% if teacher_view %}
<form method="post" action="/materials/{{ item.id }}/delete"
onsubmit="return confirm('{{ _("Удалить") }} «{{ item.title }}»?')">
<button class="danger small staff-only" type="submit">{{ icon("trash") }}</button>
</form>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="card">
{{ empty("book", _("Материалов пока нет.") if not teacher_view
else _("Материалов пока нет — выложи первый в форме выше.")) }}
</div>
{% endif %}
{% endblock %}