From 33b46792c4e38949aa4bafc234b865878a08b192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Tue, 21 Apr 2026 15:13:53 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=823?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/script.js | 4 ++++ static/styles.css | 31 +++++++++++++++++++++++++++++++ templates/match_workspace.html | 17 +++++++++++++---- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/static/script.js b/static/script.js index 6f3f1a1..c359c53 100644 --- a/static/script.js +++ b/static/script.js @@ -2115,6 +2115,10 @@ function renderLineupRow(row) { ${actionsHtml} `; } + + + + function makeDraggable(el) { let dragging = false; diff --git a/static/styles.css b/static/styles.css index effc09e..d8c0d42 100644 --- a/static/styles.css +++ b/static/styles.css @@ -2260,4 +2260,35 @@ body:not(.edit-mode-on) .referee-search { .coach-link-btn:hover .coach-name, .coach-left:hover .coach-name { color: #a9c7ff; +} + +.player-link-btn { + display: block; + width: 100%; + padding: 0; + margin: 0; + border: none; + background: transparent; + color: inherit; + text-align: left; + cursor: pointer; + font: inherit; +} + +.player-link-btn .last-name, +.player-link-btn .first-name { + color: #8ab4ff; + text-decoration: underline; + text-underline-offset: 2px; +} + +.player-link-btn:hover .last-name, +.player-link-btn:hover .first-name { + color: #a9c7ff; +} + +.player-link-btn:focus-visible { + outline: 2px solid rgba(138, 180, 255, 0.45); + outline-offset: 2px; + border-radius: 6px; } \ No newline at end of file diff --git a/templates/match_workspace.html b/templates/match_workspace.html index 233090e..f551bd3 100644 --- a/templates/match_workspace.html +++ b/templates/match_workspace.html @@ -1495,6 +1495,14 @@ return; } + function swapNameParts(rawName) { + const parts = String(rawName || "").trim().split(/\s+/).filter(Boolean); + if (parts.length >= 2) { + return `${parts[1]} ${parts[0]}`; + } + return String(rawName || "").trim(); + } + async function sendNeutralPersonTitle(name, role, logoUrl) { const inputName = "ИГРОК - НЕЙТРАЛЬНЫЙ"; @@ -1540,14 +1548,15 @@ const trigger = event.target.closest(".vmix-person-trigger"); if (!trigger) return; - const side = trigger.dataset.side; - const name = (trigger.dataset.name || "").trim(); + const side = (trigger.dataset.side || "").trim(); + const rawName = (trigger.dataset.name || "").trim(); const role = (trigger.dataset.role || "").trim(); const logoUrl = side === "away" ? teamLogos.away : teamLogos.home; - if (!name) return; + if (!rawName) return; - sendNeutralPersonTitle(name, role, logoUrl); + const formattedName = swapNameParts(rawName); + sendNeutralPersonTitle(formattedName, role, logoUrl); }); })();