Files
152-fz-scanner/reports/templates/report.html.j2
T
neo de18090304 🏗 Фаза 1-4: Архитектура, ядро, проверки, API, генератор отчетов
- scanner/engine.py — Playwright-движок сканирования
- scanner/models.py — Pydantic модели
- scanner/checks/ — 5 проверок (cookie, privacy, forms, server, external)
- api/server.py — FastAPI REST API
- reports/generator.py — PDF через WeasyPrint + Jinja2
- main.py — CLI + сервер

Проверки:
✅ cookie_banner — поиск cookie-баннера
✅ privacy_link — проверка ссылки на политику
✅ form_checkbox — проверка чекбоксов согласия
✅ server_location — геолокация сервера (RФ или нет)
✅ external_scripts — внешние скрипты аналитики
2026-06-09 21:10:21 +05:00

229 lines
7.2 KiB
Django/Jinja

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Аудит по 152-ФЗ — {{ site_scan.url }}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: #1a1a2e;
line-height: 1.6;
padding: 40px;
}
.header {
text-align: center;
margin-bottom: 40px;
padding-bottom: 20px;
border-bottom: 3px solid #0f3463;
}
.header h1 {
font-size: 28px;
color: #0f3463;
margin-bottom: 8px;
}
.header p {
color: #666;
font-size: 14px;
}
.score-card {
text-align: center;
padding: 30px;
border-radius: 12px;
margin: 30px 0;
background: {{ '#e8f5e9' if is_compliant else '#ffebee' }};
}
.score-number {
font-size: 64px;
font-weight: 700;
color: {{ '#2e7d32' if is_compliant else '#c62828' }};
}
.score-label {
font-size: 18px;
color: #555;
margin-top: 8px;
}
.summary-box {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
border-left: 4px solid #0f3463;
}
.summary-box h3 {
margin-bottom: 10px;
color: #0f3463;
}
.table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.table th, .table td {
padding: 12px 16px;
text-align: left;
border-bottom: 1px solid #ddd;
}
.table th {
background: #f8f9fa;
font-weight: 600;
color: #0f3463;
}
.status-pass {
color: #2e7d32;
font-weight: 600;
}
.status-fail {
color: #c62828;
font-weight: 600;
}
.status-skip {
color: #f57c00;
font-weight: 600;
}
.status-error {
color: #d32f2f;
font-weight: 600;
}
.risk-critical {
background: #ffebee;
color: #c62828;
padding: 2px 8px;
border-radius: 4px;
font-weight: 600;
}
.risk-high {
background: #fff3e0;
color: #e65100;
padding: 2px 8px;
border-radius: 4px;
font-weight: 600;
}
.risk-medium {
background: #fff8e1;
color: #f57c00;
padding: 2px 8px;
border-radius: 4px;
}
.risk-low {
background: #e8f5e9;
color: #2e7d32;
padding: 2px 8px;
border-radius: 4px;
}
.cta-section {
background: #0f3463;
color: white;
padding: 30px;
border-radius: 12px;
margin-top: 40px;
text-align: center;
}
.cta-section h2 {
font-size: 22px;
margin-bottom: 10px;
}
.cta-section p {
font-size: 14px;
opacity: 0.9;
margin-bottom: 20px;
}
.cta-button {
display: inline-block;
background: white;
color: #0f3463;
padding: 12px 24px;
border-radius: 6px;
text-decoration: none;
font-weight: 600;
margin: 5px;
}
.footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #ddd;
text-align: center;
color: #999;
font-size: 12px;
}
</style>
</head>
<body>
<div class="header">
<h1>📋 Аудит соответствия 152-ФЗ</h1>
<p>Автоматизированный сканер | {{ site_scan.url }}</p>
<p>Дата проверки: {{ scanned_at }}</p>
<p>Версия сканера: {{ scanner_version }}</p>
</div>
<div class="score-card">
<div class="score-number">{{ score }}</div>
<div class="score-label">
{{ '✅ Сайт соответствует 152-ФЗ' if is_compliant else '❌ Сайт НЕ соответствует 152-ФЗ' }}
</div>
</div>
<div class="summary-box">
<h3>📊 Резюме проверки</h3>
<p>{{ summary }}</p>
</div>
<h2>📝 Результаты проверок</h2>
<table class="table">
<thead>
<tr>
<th>Проверка</th>
<th>Статус</th>
<th>Риск</th>
<th>Детали</th>
</tr>
</thead>
<tbody>
{% for check in checks %}
<tr>
<td><strong>{{ check.title }}</strong></td>
<td>
{% if check.status == 'pass' %}
<span class="status-pass">✅ Пройдено</span>
{% elif check.status == 'fail' %}
<span class="status-fail">❌ Не пройдено</span>
{% elif check.status == 'skip' %}
<span class="status-skip">⏭ Пропущено</span>
{% elif check.status == 'error' %}
<span class="status-error">⚠️ Ошибка</span>
{% endif %}
</td>
<td>
{% if check.risk_level == 'critical' %}
<span class="risk-critical">🔴 Критический</span>
{% elif check.risk_level == 'high' %}
<span class="risk-high">🟠 Высокий</span>
{% elif check.risk_level == 'medium' %}
<span class="risk-medium">🟡 Средний</span>
{% else %}
<span class="risk-low">🟢 Низкий</span>
{% endif %}
</td>
<td>{{ check.message }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="cta-section">
<h2>Нужна помощь с приведением сайта в соответствие 152-ФЗ?</h2>
<p>Мы исправим все найденные нарушения, подготовим документы и настроим cookie-баннеры.</p>
<p style="margin-top: 20px; font-size: 18px;">💰 Стоимость: от 7 000 ₽ (зависит от объема нарушений)</p>
<div style="margin-top: 20px;">
<span class="cta-button">📧 Написать на email</span>
<span class="cta-button">💬 Telegram</span>
</div>
</div>
<div class="footer">
<p>Документ сгенерирован автоматически. Не является юридической консультацией.</p>
<p>© 2026 152-ФЗ Scanner | Powered by AI Compliance</p>
</div>
</body>
</html>