From 78493b92485dc57ef6f38e52172c1d7f91da6cb9 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 28 Aug 2026 16:01:00 +0300 Subject: [PATCH] fix: complete admin UX review findings --- CHANGELOG.md | 2 +- app/static/admin.css | 24 ++++++++++++++++++++---- app/static/admin.js | 16 +++++++++++++++- app/templates/dashboard.html | 2 +- app/templates/directory.html | 10 ++++++++-- app/templates/runs.html | 4 ++-- app/version.py | 6 +++--- pyproject.toml | 2 +- tests/test_admin_templates.py | 3 +++ tests/test_api.py | 2 +- 10 files changed, 55 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a176b0f..8538bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.7.9 +## 0.8.0 - Улучшены доступность, фильтры, состояния и адаптивность административного каталога. diff --git a/app/static/admin.css b/app/static/admin.css index 26cb0ed..d1c5ea2 100644 --- a/app/static/admin.css +++ b/app/static/admin.css @@ -711,10 +711,26 @@ border-radius: 6px; } -.columns-modal__checkbox { - width: 16px; - height: 16px; -} +.columns-modal__checkbox { + width: 16px; + height: 16px; +} + +.columns-modal__presets { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + margin-top: 18px; + padding: 0; + border: 0; +} + +.columns-modal__preset-label { + color: #4b5563; + font-size: 13px; + font-weight: 700; +} @media (max-width: 920px) { .directory__filters { diff --git a/app/static/admin.js b/app/static/admin.js index 79aa0af..2eecdae 100644 --- a/app/static/admin.js +++ b/app/static/admin.js @@ -11,6 +11,11 @@ "profile", ]; const storageKey = "miem.directory.columns"; + const columnPresets = { + review: ["full_name", "status", "academic_degree", "last_seen_at", "profile"], + contacts: ["full_name", "status", "email", "phone", "address", "profile"], + full: ["full_name", "status", "positions", "hse_start_year", "email", "phone", "address", "academic_degree", "publications_count", "courses_count", "news_count", "first_seen_at", "last_seen_at", "dismissed_at", "profile"], + }; function readColumns() { try { @@ -53,6 +58,13 @@ modal.close(); }); }); + document.querySelectorAll("[data-columns-preset]").forEach((button) => { + button.addEventListener("click", () => { + columns = columnPresets[button.dataset.columnsPreset]; + writeColumns(columns); + applyColumns(columns); + }); + }); modal.addEventListener("click", (event) => { if (event.target === modal) modal.close(); }); @@ -109,10 +121,12 @@ } catch (_error) { const error = document.querySelector("[data-progress-error]"); if (error) error.hidden = false; - return false; + return true; } }; + document.querySelectorAll("[data-progress-retry]").forEach((button) => button.addEventListener("click", poll)); + const interval = window.setInterval(async () => { const keepGoing = await poll(); if (!keepGoing) window.clearInterval(interval); diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index fe416bc..ea19408 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -50,7 +50,7 @@
{{ run.progress_percent if run else 0 }}%
- +
diff --git a/app/templates/directory.html b/app/templates/directory.html index 92cc38f..5eb6da5 100644 --- a/app/templates/directory.html +++ b/app/templates/directory.html @@ -133,8 +133,8 @@
- -
+ +

Отображаемые колонки

@@ -144,6 +144,12 @@ {% endfor %}
+
+ Быстрый набор + + + +
{% endblock %} diff --git a/app/templates/runs.html b/app/templates/runs.html index 52e21f2..ce0c2d7 100644 --- a/app/templates/runs.html +++ b/app/templates/runs.html @@ -21,7 +21,7 @@
{{ percent }}%
- + {% else %}
@@ -35,7 +35,7 @@
0%
- + {% endif %} diff --git a/app/version.py b/app/version.py index 3fe1651..6df5956 100644 --- a/app/version.py +++ b/app/version.py @@ -1,3 +1,3 @@ -APP_VERSION = "0.7.9" -FRONTEND_VERSION = "0.7.9" -BACKEND_VERSION = "0.7.9" +APP_VERSION = "0.8.0" +FRONTEND_VERSION = "0.8.0" +BACKEND_VERSION = "0.8.0" diff --git a/pyproject.toml b/pyproject.toml index e77b570..f22eb95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "miem-workers" -version = "0.7.9" +version = "0.8.0" description = "MIEM employees parser, admin API, and web admin" requires-python = ">=3.11" dependencies = [ diff --git a/tests/test_admin_templates.py b/tests/test_admin_templates.py index 78ada5e..1c78268 100644 --- a/tests/test_admin_templates.py +++ b/tests/test_admin_templates.py @@ -33,7 +33,9 @@ def test_directory_template_is_russian_and_uses_display_dates(): assert '