From a9cb0fa57fbc708dffa307ddb33fede68ca6a57c Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 10 Aug 2026 16:48:06 +0200 Subject: [PATCH] Turn admin lobby chat panel into a tab The lobby chat was a standalone card sitting above the per-player log tabs. Folds it into the same tab bar as the first (default-active) tab instead, so the session log view has one consistent tab strip. The tab-switching script now toggles by an .admin-tab-panel class instead of assuming every panel's id starts with "player-", since that's no longer true. Co-Authored-By: Claude Sonnet 5 --- assets/admin-session-tabs.js | 2 +- templates/game/admin/sessions/view.html.twig | 130 +++++++++++-------- 2 files changed, 75 insertions(+), 57 deletions(-) diff --git a/assets/admin-session-tabs.js b/assets/admin-session-tabs.js index a913751..437afde 100644 --- a/assets/admin-session-tabs.js +++ b/assets/admin-session-tabs.js @@ -5,7 +5,7 @@ document.addEventListener('DOMContentLoaded', () => { } const activate = (id) => { - document.querySelectorAll('[id^="player-"]').forEach(el => el.style.display = 'none'); + document.querySelectorAll('.admin-tab-panel').forEach(el => el.style.display = 'none'); const target = document.getElementById(id); if (target) { target.style.display = 'block'; diff --git a/templates/game/admin/sessions/view.html.twig b/templates/game/admin/sessions/view.html.twig index cfbda72..589965b 100644 --- a/templates/game/admin/sessions/view.html.twig +++ b/templates/game/admin/sessions/view.html.twig @@ -10,9 +10,58 @@

{{ session.game.name }} — Session #{{ session.id }}

{{ session.status.value }} · {{ session.players|length }} player(s) · Created {{ session.created|date('Y-m-d H:i') }}

-
-

Pregame lobby chat

+ {# Tab buttons #} +
+ + {% for playerLog in playersLogs %} + + {% endfor %} +
+ {# Tab content #} +
{% if lobbyMessages is empty %}

No lobby chat messages for this session.

{% else %} @@ -28,59 +77,28 @@ {% endif %}
- {% if playersLogs is empty %} -
- No players in this session. + {% for playerLog in playersLogs %} +
+
{{ playerLog.logs ?: 'No logs found for this player.' }}
- {% else %} - {# Tab buttons #} -
- {% for playerLog in playersLogs %} - - {% endfor %} -
- - {# Tab content #} - {% for playerLog in playersLogs %} -
-
{{ playerLog.logs ?: 'No logs found for this player.' }}
-
- {% endfor %} - {% endif %} + {% endfor %} {% endblock %}