diff --git a/app.py b/app.py index b835a37..afc755c 100644 --- a/app.py +++ b/app.py @@ -30,7 +30,8 @@ from ui_builder import install_ui_builder from khl_site.khl_data_center import APP as khl_site_app BASE_DIR = Path(__file__).resolve().parent -BUILD_VERSION = "2026.09.23.6" +BUILD_VERSION = "2026.09.23.7" +# compatibility: BUILD_VERSION = "2026.09.23.6" # compatibility: BUILD_VERSION = "2026.08.26.1" # compatibility: BUILD_VERSION = "2026.08.25.1" # compatibility: BUILD_VERSION = "2026.08.24.15" diff --git a/hockey_data/mapping_context.py b/hockey_data/mapping_context.py index 2500411..36a0a8a 100644 --- a/hockey_data/mapping_context.py +++ b/hockey_data/mapping_context.py @@ -973,6 +973,7 @@ class MappingDataService: (2, "color_2_hex", "color_2_enabled"), (3, "color_3_hex", "color_3_enabled"), (4, "color_4_hex", "color_4_enabled"), + (5, "color_5_hex", "color_5_enabled"), ) for index, color_field, enabled_field in color_specs: raw_color = str(getattr(team, color_field, "") or "") if team is not None else "" diff --git a/hockey_data/models.py b/hockey_data/models.py index 55e26c8..e2b2a8e 100644 --- a/hockey_data/models.py +++ b/hockey_data/models.py @@ -264,6 +264,8 @@ class Team(Base): color_3_enabled: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False) color_4_hex: Mapped[str] = mapped_column(String(9), nullable=False, default="") color_4_enabled: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False) + color_5_hex: Mapped[str] = mapped_column(String(9), nullable=False, default="") + color_5_enabled: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False) # BUILD135: three operator-editable logo locations. ``logo_url`` remains # logo #1 for backwards compatibility with existing SQL/mappings. logo_url: Mapped[str] = mapped_column(Text, nullable=False, default="") diff --git a/hockey_data/router.py b/hockey_data/router.py index b9fa27c..f1a0041 100644 --- a/hockey_data/router.py +++ b/hockey_data/router.py @@ -175,6 +175,8 @@ class TeamDirectoryPayload(BaseModel): color_3_enabled: bool = False color_4_hex: str = Field(default="", max_length=9) color_4_enabled: bool = False + color_5_hex: str = Field(default="", max_length=9) + color_5_enabled: bool = False logo_url: str = Field(default="", max_length=2000) logo_2_url: str = Field(default="", max_length=2000) logo_3_url: str = Field(default="", max_length=2000) diff --git a/hockey_data/service.py b/hockey_data/service.py index 94c45a6..dc0bcff 100644 --- a/hockey_data/service.py +++ b/hockey_data/service.py @@ -1793,11 +1793,14 @@ class HockeyDataService: "color_3_enabled": bool(team.color_3_enabled), "color_4_hex": team.color_4_hex, "color_4_enabled": bool(team.color_4_enabled), + "color_5_hex": team.color_5_hex, + "color_5_enabled": bool(team.color_5_enabled), "colors": [ {"index": 1, "hex": team.color_hex, "enabled": bool(team.color_enabled)}, {"index": 2, "hex": team.color_2_hex, "enabled": bool(team.color_2_enabled)}, {"index": 3, "hex": team.color_3_hex, "enabled": bool(team.color_3_enabled)}, {"index": 4, "hex": team.color_4_hex, "enabled": bool(team.color_4_enabled)}, + {"index": 5, "hex": team.color_5_hex, "enabled": bool(team.color_5_enabled)}, ], "logo_url": team.logo_url, "logo_2_url": team.logo_2_url, @@ -1957,6 +1960,7 @@ class HockeyDataService: ("color_2_hex", "color_2_enabled"), ("color_3_hex", "color_3_enabled"), ("color_4_hex", "color_4_enabled"), + ("color_5_hex", "color_5_enabled"), ) for color_field, enabled_field in color_fields: if color_field in payload and payload[color_field] is not None: diff --git a/hockey_data/static/admin-directories.js b/hockey_data/static/admin-directories.js index 60b9580..503f0e6 100644 --- a/hockey_data/static/admin-directories.js +++ b/hockey_data/static/admin-directories.js @@ -150,7 +150,7 @@ `; }; - const teamColorsCellMarkup = (item) => [1, 2, 3, 4].map((index) => { + const teamColorsCellMarkup = (item) => [1, 2, 3, 4, 5].map((index) => { const field = teamColorFieldName(index); const enabledField = teamColorEnabledName(index); const value = normalizeTeamColorHex(item?.[field]); @@ -499,6 +499,7 @@ ${teamColorEditorMarkup(editing, 2)} ${teamColorEditorMarkup(editing, 3)} ${teamColorEditorMarkup(editing, 4)} + ${teamColorEditorMarkup(editing, 5)} @@ -3928,14 +3929,14 @@ }); updateEnabledUi(); }; - [1, 2, 3, 4].forEach(bindTeamColor); + [1, 2, 3, 4, 5].forEach(bindTeamColor); modal.querySelector("[data-team-form]")?.addEventListener("submit", async (event) => { event.preventDefault(); const form = event.currentTarget; const values = new FormData(form); const normalizedColors = {}; - for (const index of [1, 2, 3, 4]) { + for (const index of [1, 2, 3, 4, 5]) { const field = teamColorFieldName(index); const enabledField = teamColorEnabledName(index); const raw = String(values.get(field) || "").trim(); @@ -3967,6 +3968,8 @@ color_3_enabled: normalizedColors.color_3_enabled, color_4_hex: normalizedColors.color_4_hex, color_4_enabled: normalizedColors.color_4_enabled, + color_5_hex: normalizedColors.color_5_hex, + color_5_enabled: normalizedColors.color_5_enabled, logo_url: normalizeTeamMediaPath(values.get("logo_url") || ""), logo_2_url: normalizeTeamMediaPath(values.get("logo_2_url") || ""), logo_3_url: normalizeTeamMediaPath(values.get("logo_3_url") || ""),