From a336612ad5cd5128483982210ee3531784bf9fc7 Mon Sep 17 00:00:00 2001 From: Vladislav Kopnin Date: Mon, 26 Oct 2026 18:29:22 +0300 Subject: [PATCH] fix: polish group matrix headers and cell alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - shorten intermediate attestation header to «Пр. атт.» - vertically center row cell contents and left-align values - use normal header color/weight for average, password and actions - align attestation action buttons to equal height - add a divider before the actions column --- .../ru/ysu/lms/web/AttestationPresentation.kt | 9 +++++++++ .../ru/ysu/lms/web/admin/AdminLabView.kt | 1 + .../ysu/lms/web/admin/GroupAttestationViews.kt | 1 + web/src/main/resources/static/css/app.css | 18 ++++++++++++++---- .../main/resources/templates/admin/group.html | 14 +++++++------- .../resources/templates/fragments/base.html | 2 +- 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/web/src/main/kotlin/ru/ysu/lms/web/AttestationPresentation.kt b/web/src/main/kotlin/ru/ysu/lms/web/AttestationPresentation.kt index b3c59cf..47c4b51 100644 --- a/web/src/main/kotlin/ru/ysu/lms/web/AttestationPresentation.kt +++ b/web/src/main/kotlin/ru/ysu/lms/web/AttestationPresentation.kt @@ -43,6 +43,15 @@ object AttestationPresentation { fun kindLabel(kind: String): String = KIND_LABELS[kind] ?: kind + /** Короткая подпись для шапки узкого столбца. */ + fun shortKindLabel(kind: String): String = + when (kind) { + "intermediate" -> "Пр. атт." + "pass" -> "Зачёт" + "exam" -> "Экзамен" + else -> kind + } + /** Понимает и «2», и старые значения вроде «2 семестр»; вне 1–8 — 1. */ fun semesterNumber(raw: String): Int { val digits = raw.filter { it.isDigit() } diff --git a/web/src/main/kotlin/ru/ysu/lms/web/admin/AdminLabView.kt b/web/src/main/kotlin/ru/ysu/lms/web/admin/AdminLabView.kt index ab27eba..a0ceb74 100644 --- a/web/src/main/kotlin/ru/ysu/lms/web/admin/AdminLabView.kt +++ b/web/src/main/kotlin/ru/ysu/lms/web/admin/AdminLabView.kt @@ -69,6 +69,7 @@ data class GroupAttestation( val id: String = "", val kind: String = "", val kindLabel: String = "", + val shortLabel: String = "", val semester: Int = 1, val published: Boolean = false, val options: List = emptyList(), diff --git a/web/src/main/kotlin/ru/ysu/lms/web/admin/GroupAttestationViews.kt b/web/src/main/kotlin/ru/ysu/lms/web/admin/GroupAttestationViews.kt index 8e028a3..173f160 100644 --- a/web/src/main/kotlin/ru/ysu/lms/web/admin/GroupAttestationViews.kt +++ b/web/src/main/kotlin/ru/ysu/lms/web/admin/GroupAttestationViews.kt @@ -18,6 +18,7 @@ object GroupAttestationViews { id = column.id, kind = column.kind, kindLabel = AttestationPresentation.kindLabel(column.kind), + shortLabel = AttestationPresentation.shortKindLabel(column.kind), semester = AttestationPresentation.semesterNumber(column.semester), published = column.published, options = diff --git a/web/src/main/resources/static/css/app.css b/web/src/main/resources/static/css/app.css index 3b2c495..edb4822 100644 --- a/web/src/main/resources/static/css/app.css +++ b/web/src/main/resources/static/css/app.css @@ -546,17 +546,22 @@ dialog.dlg.dlg-lg .dlg-body { max-height: 88vh; min-height: 62vh; } .scroll-x { overflow-x: auto; } .matrix { border-collapse: separate; border-spacing: 0; } .matrix th { - vertical-align: top; padding: 0.75rem 1rem; text-align: left; + vertical-align: middle; padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 500; color: var(--c-text-muted); background: var(--c-surface); white-space: nowrap; } -.matrix td { vertical-align: top; padding: 1rem; } +.matrix td { vertical-align: middle; padding: 1rem; } /* Непрозрачный фон обязателен: закреплённый столбец не должен просвечивать при прокрутке. */ .matrix tbody tr:hover td { background: var(--c-row-hover); } .matrix tbody tr:hover td.matrix-sticky { background: var(--c-row-hover); } .matrix tbody tr:last-child td { border-bottom: none; } .matrix th.lab-col { min-width: 9.5rem; border-left: 1px solid var(--c-border); } .matrix td.cell-lab { min-width: 9.5rem; border-left: 1px solid var(--c-border); } +#group-table th.password-col, +#group-table th.average-col, +#group-table th.actions-head { color: var(--c-text); font-weight: 400; } +#group-table th.actions-head, +#group-table td.actions-cell { border-left: 1px solid var(--c-border); } .matrix th.attestation-col { width: 11rem; min-width: 10rem; max-width: 11rem; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); } .matrix td.attestation-cell { width: 11rem; min-width: 10rem; max-width: 11rem; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); } .matrix th.average-col { min-width: 7rem; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); } @@ -564,14 +569,19 @@ dialog.dlg.dlg-lg .dlg-body { max-height: 88vh; min-height: 62vh; } .attestation-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; width: 100%; max-width: 9rem; text-align: left; } .attestation-kind { font-weight: 400; color: var(--c-text); white-space: normal; text-align: left; } .attestation-col .lab-col-head, .attestation-col .lab-col-title { text-align: left; } -.js-attestation-form { display: flex; justify-content: center; width: 100%; } +.attestation-col .lab-head-actions .btn { + width: 1.7rem; height: 1.7rem; min-height: 1.7rem; padding: 0; + display: inline-flex; align-items: center; justify-content: center; +} +.attestation-col .lab-head-actions .ico { font-size: 0.95rem; line-height: 1; } +.js-attestation-form { display: flex; justify-content: flex-start; width: 100%; } .attestation-select { appearance: none; -webkit-appearance: none; width: 9rem; max-width: 100%; min-width: 0; padding: 0.15rem 1.15rem 0.15rem 0.35rem; border: 1px solid transparent; border-radius: var(--radius-sm); background-color: transparent; color: var(--c-text); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; - text-align: center; text-align-last: center; cursor: pointer; + text-align: left; text-align-last: left; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); diff --git a/web/src/main/resources/templates/admin/group.html b/web/src/main/resources/templates/admin/group.html index 9fe6bf1..c9965ae 100644 --- a/web/src/main/resources/templates/admin/group.html +++ b/web/src/main/resources/templates/admin/group.html @@ -73,11 +73,11 @@ - Средний балл + Средний балл
- Аттестация + Пр. атт.
Семестр 1
@@ -105,8 +105,8 @@
- Пароль - Действия + Пароль + Действия @@ -155,9 +155,9 @@ - — - +
@@ -172,7 +172,7 @@
- + временный изменён diff --git a/web/src/main/resources/templates/fragments/base.html b/web/src/main/resources/templates/fragments/base.html index d9482f5..e0d9e30 100644 --- a/web/src/main/resources/templates/fragments/base.html +++ b/web/src/main/resources/templates/fragments/base.html @@ -17,7 +17,7 @@ - +