Initial import: vesti.nixg.ru — новостной апрув-проект (web, crawler, classifier, publisher, openspec)

This commit is contained in:
kpa39l
2026-09-13 15:58:32 +00:00
commit c3f59f7b7a
113 changed files with 7065 additions and 0 deletions
@@ -0,0 +1,26 @@
## Why
Даты в веб-UI отображаются как ISO-строка из SQLite: `2026-08-15T15:53` (срез `[:16]`
в шаблонах `candidates.html`, `published.html`, `metrics.html`). Пользователь хочет
человекочитаемый формат: `20:00 15.08.2026` (время ЧЧ:ММ, дата ДД.ММ.ГГГГ).
Места:
- `web/templates/candidates.html:…` — `{{ (p.published_at or '')[:16] }}`
- `web/templates/published.html:10` — `{{ (p.published_at or '')[:16] }}`
- `web/templates/metrics.html:23` — `{{ (r.started_at or '')[:16] }}`
## What Changes
- Добавить Jinja2-фильтр `dt` (datetime): парсит ISO-строку `2026-08-15T15:53[:00]`,
выводит `20:00 15.08.2026`.
- Во всех трёх шаблонах заменить `{{ (x or '')[:16] }}` → `{{ x | dt }}`.
- Использовать `datetime.fromisoformat` + `strftime("%H:%M %d.%m.%Y")`.
- Если строка не парсится (None/мусор) — выводить пустую строку/прочерк (не падать).
## Impact
- Файлы: `web/app.py` (фильтр `dt`), шаблоны `candidates.html`, `published.html`,
`metrics.html` (замена вызовов).
- Новых зависимостей нет (stdlib `datetime`).
- Никакого JS: форматирование на сервере.
- Rollback: вернуть `[:16]` в трёх шаблонах, убрать фильтр.