From aee1672058d37069d0c275db8e21c4c319e9b8a8 Mon Sep 17 00:00:00 2001 From: Vladislav Kopnin Date: Fri, 2 Oct 2026 17:31:06 +0300 Subject: [PATCH] Learn pages: icon actions (eye/pencil/hand/trash), centered accordion arrows; toasts bottom-center in B3 style --- web/src/main/resources/static/css/app.css | 33 +++++++++-------- .../main/resources/templates/admin/group.html | 4 +-- .../resources/templates/learn/article.html | 7 ++-- .../resources/templates/learn/chapter.html | 33 ++++++++--------- .../main/resources/templates/learn/index.html | 36 ++++++++----------- .../resources/templates/learn/section.html | 20 +++++------ 6 files changed, 62 insertions(+), 71 deletions(-) diff --git a/web/src/main/resources/static/css/app.css b/web/src/main/resources/static/css/app.css index 1fc75a2..48c8b06 100644 --- a/web/src/main/resources/static/css/app.css +++ b/web/src/main/resources/static/css/app.css @@ -228,7 +228,7 @@ tr:last-child td { border-bottom: none; } .alert-warning { background: #fef3c7; color: #92400e; } .list-pad { padding-left: 1.25rem; } -.import-card { border-color: rgba(16,185,129,0.4); } +.import-card { border-color: var(--c-badge-ok-border); } .mini-alert { padding: 0.5rem 0.75rem; border-radius: var(--radius-xs); margin-bottom: 0.5rem; } /* Theme toggle */ .theme-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; } @@ -258,29 +258,32 @@ tr:last-child td { border-bottom: none; } .toast { position: fixed; top: 1rem; right: 1rem; z-index: 50; width: 20rem; } /* Всплывающие уведомления (flash notice/error) вместо статичных алертов */ +/* Уведомления: внизу по центру, в стиле Б3 (поверх .notice) */ .toast-host { - position: fixed; top: 1rem; right: 1rem; z-index: 100; - display: flex; flex-direction: column; gap: 0.5rem; - width: min(24rem, calc(100vw - 2rem)); pointer-events: none; + position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.5rem; z-index: 100; + display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; + width: min(34rem, calc(100vw - 2rem)); pointer-events: none; } .toast-item { - pointer-events: auto; display: flex; align-items: flex-start; gap: 0.5rem; - padding: 0.7rem 0.85rem; border-radius: var(--radius); border: 1px solid var(--c-border); - border-left-width: 4px; background: var(--c-surface); color: var(--c-text); - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); + pointer-events: auto; display: flex; align-items: flex-start; gap: 0.75rem; + padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--c-border); + border-left: 3px solid var(--c-accent); background: var(--c-surface); color: var(--c-text); + font-size: 0.8125rem; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); animation: toast-in 0.18s ease-out; } .toast-item .toast-text { flex: 1 1 auto; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; } -.toast-item.toast-success { border-left-color: #16a34a; } -.toast-item.toast-error { border-left-color: #dc2626; } -.toast-item.toast-warning { border-left-color: #d97706; } +.toast-item .toast-text .code { margin: 0 0.1rem; } +.toast-item.toast-success { border-left-color: var(--c-tone-pos); } +.toast-item.toast-error { border-left-color: var(--c-tone-neg); } +.toast-item.toast-warning { border-left-color: var(--c-badge-warn-text); } .toast-close { flex: 0 0 auto; border: none; background: none; cursor: pointer; - color: var(--c-text-muted); font-size: 1.05rem; line-height: 1; padding: 0 0.1rem; + color: var(--c-text-muted); font-size: 1rem; line-height: 1; padding: 0 0.1rem; } .toast-close:hover { color: var(--c-text); } @keyframes toast-in { - from { opacity: 0; transform: translateY(-6px); } + from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } @@ -494,7 +497,7 @@ dialog.modal.modal-lg .modal-body { max-height: 88vh; min-height: 62vh; } } .sub-toggle:hover { color: var(--c-text); } .sub-arrow { - flex: 0 0 auto; width: 8px; height: 8px; + display: block; flex: 0 0 auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg); transition: transform 0.2s; } @@ -614,7 +617,9 @@ th.th-filterable { padding-bottom: 0.35rem; } cursor: grab; user-select: none; color: var(--c-text-muted); font-size: 1rem; line-height: 1; padding: 0.15rem 0; border-radius: var(--radius-sm); } +.drag-handle svg { width: 1rem; height: 1rem; display: block; margin: 0 auto; } .drag-handle:hover { background: var(--c-bg); color: var(--c-text); } +.mini-btn.danger:hover { color: var(--c-accent); border-color: #dcb9be; background: var(--c-accent-soft); } .drag-handle:active { cursor: grabbing; } .dragging { opacity: 0.45; } .drop-before { box-shadow: 0 -3px 0 0 var(--c-text); } diff --git a/web/src/main/resources/templates/admin/group.html b/web/src/main/resources/templates/admin/group.html index e33561a..3497189 100644 --- a/web/src/main/resources/templates/admin/group.html +++ b/web/src/main/resources/templates/admin/group.html @@ -307,7 +307,7 @@ -
+

Студент добавлен

—

@@ -317,7 +317,7 @@
-
+

Группа — импортирована diff --git a/web/src/main/resources/templates/learn/article.html b/web/src/main/resources/templates/learn/article.html index 57ef175..512004f 100644 --- a/web/src/main/resources/templates/learn/article.html +++ b/web/src/main/resources/templates/learn/article.html @@ -52,9 +52,8 @@ - + + К главе @@ -62,7 +61,7 @@ onsubmit="return confirm('Удалить статью?')"> - +

diff --git a/web/src/main/resources/templates/learn/chapter.html b/web/src/main/resources/templates/learn/chapter.html index 735d495..7a22090 100644 --- a/web/src/main/resources/templates/learn/chapter.html +++ b/web/src/main/resources/templates/learn/chapter.html @@ -16,26 +16,25 @@
- +
- + +
- +
- Перетаскивайте за значок ⠿ слева, чтобы менять порядок разделов и переносить статьи + Перетаскивайте за значок руки слева, чтобы менять порядок разделов и переносить статьи между разделами этой главы. Порядок сохраняется сразу.
@@ -89,7 +85,7 @@
  • ⠿ + title="Перетащите мышью: изменить порядок или перенести в другой раздел"> Статья @@ -102,9 +98,8 @@ - + +
  • diff --git a/web/src/main/resources/templates/learn/index.html b/web/src/main/resources/templates/learn/index.html index 06c6402..6c6bc90 100644 --- a/web/src/main/resources/templates/learn/index.html +++ b/web/src/main/resources/templates/learn/index.html @@ -24,7 +24,7 @@
    ⠿ + title="Перетащите мышью: изменить порядок глав">

    Глава

    скрыто
    @@ -32,16 +32,14 @@ - + + - +
    - +
    @@ -54,7 +52,7 @@
    ⠿ + title="Перетащите мышью: изменить порядок или перенести раздел"> + + - - + +
    - +
    @@ -89,7 +84,7 @@
  • ⠿ + title="Перетащите мышью: изменить порядок или перенести статью"> Статья @@ -99,16 +94,15 @@ - + + Править
    - +
  • diff --git a/web/src/main/resources/templates/learn/section.html b/web/src/main/resources/templates/learn/section.html index 2a87711..28cb1ef 100644 --- a/web/src/main/resources/templates/learn/section.html +++ b/web/src/main/resources/templates/learn/section.html @@ -18,27 +18,26 @@
    - +
    - + +
    - +
    - +
    - Перетаскивайте статьи за значок ⠿, чтобы менять их порядок. Порядок сохраняется сразу. + Перетаскивайте статьи за значок руки, чтобы менять их порядок. Порядок сохраняется сразу.