From d3ed57227e2136353bc7c9c4fb4827456ce927bb Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Tue, 10 Mar 2026 20:56:56 +0100 Subject: [PATCH] display warning that rules only affect new games --- ui/session.js | 5 ++++- ui/session_head.js | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/session.js b/ui/session.js index c5073d0..abf350b 100644 --- a/ui/session.js +++ b/ui/session.js @@ -27,7 +27,10 @@ export default class SessionView { ]), this.#headOpen - ? m("._alternate._apply.wb-box", m(SessionHead, { model })) + ? m("._alternate._apply.wb-box", m(SessionHead, { + model, + noteNextGame: true, + })) : null, m("section.spacer", [ diff --git a/ui/session_head.js b/ui/session_head.js index 5ceb740..f103fa2 100644 --- a/ui/session_head.js +++ b/ui/session_head.js @@ -4,10 +4,24 @@ import { RaisingRule } from "/models/game_rules.js"; import Session from "/models/session.js"; export default class SessionHead { - /** @param {{ attrs: { model: Session } }} param The session model to use. */ - view({ attrs: { model } }) { + /** The attributes a `SessionHead` component can handle. + * + * @typedef {Object} SessionHeadAttrs + * @property {Session} model The session model to use. + * @property {boolean} noteNextGame + * If set, show a message that rules only come into effect for the next game. + */ + + /** @param {{ attrs: SessionHeadAttrs }} param Parameters for the component */ + view({ attrs: { model, noteNextGame } }) { return m("section", [ m("h3._positioned", "Satzeinstellungen"), + noteNextGame + ? m("p", + "Obacht, wennst di Regln ändast, geltn di neien erst fürs naxte ", + "Spiel." + ) + : null, m("section", [ m("h4", "Teamnamen"), m("label.wb-field", [