5 цвет у команд

This commit is contained in:
2026-09-23 20:54:50 +03:00
parent c481a7ef61
commit b96f82015d
6 changed files with 17 additions and 4 deletions

View File

@@ -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)}
</div>
</div>
<label class="hockey-directory-check"><input type="checkbox" name="active" ${editing?.active === false ? "" : "checked"}><span>Активна</span></label>
@@ -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") || ""),