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 @@
Не удалось обновить прогресс. Повторите позже.
+Не удалось обновить прогресс.