Files

140 lines
4.9 KiB
Django/Jinja

<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ title }}</title>
<style>
{{ css_text | safe }}
</style>
<script>{{ chart_js_content | safe }}</script>
</head>
<body>
<div class="page">
<header class="header">
<div class="title">
<h1>{{ title }}</h1>
<p>{{ hint }}</p>
</div>
<div class="actions">
<button class="btn primary" onclick="printReport()">
Печать / PDF
</button>
</div>
</header>
<section class="screen-nav" aria-label="Навигация по отчёту">
<div class="section-nav">
{% for section in report.sections %}
<button
type="button"
class="nav-btn{% if section.id == report.active_section %} active{% endif %}"
data-section="{{ section.id }}"
>
{{ section.title }}
</button>
{% endfor %}
</div>
<div class="class-nav">
{% for section in report.sections %}
<div
class="class-nav-group{% if section.id == report.active_section %} active{% endif %}"
data-section="{{ section.id }}"
>
{% for item in section.entries %}
<button
type="button"
class="nav-btn class-btn{% if item.id == report.active_class %} active{% endif %}"
data-section="{{ section.id }}"
data-class-id="{{ item.id }}"
>
{{ item.label }}
</button>
{% endfor %}
</div>
{% endfor %}
</div>
</section>
<nav class="print-nav" aria-label="Печатная навигация">
<h2>Навигация</h2>
{% for section in report.sections %}
<section class="print-nav-section">
<h3>{{ section.title }}</h3>
<ul>
{% for item in section.entries %}
<li><a href="#class-{{ item.id }}">{{ item.label }}</a></li>
{% endfor %}
</ul>
</section>
{% endfor %}
</nav>
<div class="report-sections">
{% for section in report.sections %}
<section class="report-section" data-section="{{ section.id }}">
{% for item in section.entries %}
<article
class="class-block{% if item.id == report.active_class %} active{% endif %}"
id="class-{{ item.id }}"
data-section="{{ section.id }}"
data-class-id="{{ item.id }}"
>
<div class="class-head">
<div>
<div class="class-kicker">{{ section.title }}</div>
<h3>{{ item.label }}</h3>
{% if item.description %}
<div class="class-note desc">{{ item.description }}</div>
{% endif %}
{% if item.no_schedule_warning %}
<div class="class-note warning">
⚠ Нет данных о расписании в этих аудиториях
</div>
{% endif %}
{% if item.source_labels %}
<div class="class-note">
{{ item.source_labels | join(', ') }}
</div>
{% endif %}
<div class="class-legend">
<span class="legend-item legend-conducted">Проведено {{ item.pct_conducted }}%</span>
<span class="legend-item legend-missed">Пропущено {{ item.pct_missed }}%</span>
<span class="legend-item legend-other">Не по расписанию {{ item.pct_other }}%</span>
</div>
</div>
</div>
<div class="class-chart">
<canvas class="week-chart" data-chart-for="{{ item.id }}"></canvas>
</div>
<div class="class-weeks">
{% for week in item.weeks %}
<div class="week-block">
<div class="week-header">{{ week.long }}</div>
<div class="week-stats">
<span class="stat stat-cond">Проведено {{ week.conducted_display }}</span>
<span class="stat stat-miss">Пропущено {{ week.missed_display }}</span>
<span class="stat stat-oth">Не по расписанию {{ week.other_display }}</span>
</div>
<div class="scheme-cell-wrap">
{{ week.scheme_html | safe }}
</div>
</div>
{% endfor %}
</div>
</article>
{% endfor %}
</section>
{% endfor %}
</div>
</div>
<script>
window.__CLASS_REPORT__ = {{ report_json | safe }};
</script>
<script>
{{ js_text | safe }}
</script>
</body>
</html>