feat: Add stages for processing university schedule and authentication logs

- Implemented `stage_parse_schedule.py` to normalize and prepare university schedule data.
- Created `stage_process_logs.py` for processing authentication logs and generating session records.
- Added necessary classes and methods for log entry parsing, session extraction, and CSV output.
- Updated `settings.yaml` with new schedule and processing configurations.
- Introduced new templates and styles for report generation, including HTML and CSS files.
- Added main entry point `run.py` to execute the attendance processing pipeline.
- Included `.gitkeep` files in `output` and `result` directories to maintain structure.
This commit is contained in:
2026-05-08 11:20:13 +04:00
parent 73416ac315
commit c11c9e8aa8
22 changed files with 4047 additions and 30 deletions
+141
View File
@@ -0,0 +1,141 @@
<!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>
</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.items %}
<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.items %}
<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.items %}
<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.source_labels %}
<div class="class-note">{{ item.source_labels | join(', ') }}</div>
{% endif %}
</div>
</div>
<div class="class-chart">
{{ item.chart_svg | safe }}
</div>
<div class="class-table-wrap">
<table class="class-table">
<thead>
<tr>
<th>Неделя</th>
<th>Всего пар</th>
<th>Пар проведено</th>
<th>Пар пропущено</th>
<th>Иные пары</th>
<th>Схема</th>
</tr>
</thead>
<tbody>
{% for week in item.weeks %}
<tr>
<td class="week-label">{{ week.long }}</td>
<td class="num">{{ week.total_pairs }}</td>
<td class="num">{{ week.conducted_display }}</td>
<td class="num">{{ week.missed_display }}</td>
<td class="num">{{ week.other_display }}</td>
<td class="scheme-cell-wrap">{{ week.scheme_html | safe }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</article>
{% endfor %}
</section>
{% endfor %}
</div>
</div>
<script>
window.__CLASS_REPORT__ = {{ report_json | safe }};
</script>
<script>
{{ js_text | safe }}
</script>
</body>
</html>
<!doctype html>
<html lang='ru'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>{{TITLE}}</title>
{{STYLE_TAG}}
</head>
<body>
<div class='page'>
<div class='header'>
<div class='title'>
<h1>{{TITLE}}</h1>
<p>{{HINT}}</p>
</div>
<div class='actions'>
<button class='btn primary' onclick='printReport()'>Печать / PDF</button>
</div>
</div>
{{CONTENT}}
</div>
{{SCRIPT_TAG}}
</body>
</html>