1
0
Fork 0
mirror of https://github.com/EDeev/tablo.git synced 2026-10-07 20:49:31 +03:00
tablo/app/templates/export/schedule_print.html
2026-05-25 12:48:41 +03:00

122 lines
3.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.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>{{ schedule.name }}</title>
<style>
@page {
size: A4 landscape;
margin: 1.2cm 1.5cm;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'DejaVu Sans', Arial, sans-serif;
font-size: 10px;
color: #1e293b;
background: #fff;
}
h1 {
font-size: 16px;
font-weight: 700;
margin-bottom: 4px;
color: #0f172a;
}
.meta {
font-size: 9px;
color: #64748b;
margin-bottom: 14px;
}
table {
width: 100%;
border-collapse: collapse;
table-layout: auto;
}
th {
background: #f8fafc;
border: 1px solid #e2e8f0;
padding: 5px 6px;
font-size: 9px;
font-weight: 600;
color: #475569;
text-transform: uppercase;
letter-spacing: .03em;
white-space: nowrap;
}
td {
border: 1px solid #e2e8f0;
padding: 4px 6px;
vertical-align: top;
line-height: 1.4;
}
tr:nth-child(even) td { background: #f8fafc; }
/* Цветовые бейджи типов занятий */
.badge {
display: inline-block;
padding: 1px 5px;
border-radius: 3px;
font-size: 8px;
font-weight: 600;
white-space: nowrap;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-gray { background: #f1f5f9; color: #475569; }
.day-cell { white-space: nowrap; }
.time-cell { white-space: nowrap; font-family: monospace; font-size: 9.5px; }
.muted { color: #94a3b8; }
</style>
</head>
<body>
<h1>{{ schedule.name }}</h1>
<div class="meta">Экспортировано {{ schedule.created_at.strftime('%d.%m.%Y') }} · {{ rows | length }} занятий</div>
{% if rows %}
<table>
<thead>
<tr>
<th>Предмет</th>
<th>Тип</th>
<th>Период</th>
<th>День</th>
<th>Время</th>
<th>Кабинет</th>
<th>Преподаватель</th>
</tr>
</thead>
<tbody>
{% set color_map = {
'Лекция': 'blue',
'Практика': 'green',
'Лаб. работа': 'purple',
'Лабораторная': 'purple',
'Семинар': 'teal',
'Не указано': 'gray'
} %}
{% for row in rows %}
<tr>
<td>{{ row.subject }}</td>
<td>
{% set color = color_map.get(row.type, 'gray') %}
<span class="badge badge-{{ color }}">{{ row.type }}</span>
</td>
<td>{{ row.period }}</td>
<td class="day-cell">{{ row.day | capitalize }}</td>
<td class="time-cell">{{ row.time or '' }}</td>
<td>{{ row.classroom or '<span class="muted">—</span>' }}</td>
<td>{{ row.teacher or '<span class="muted">—</span>' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="muted">Расписание пустое.</p>
{% endif %}
</body>
</html>