feat(drivers): country flag before the driver's name in timing, overlay, results, printouts and PDF (1.89.20)

This commit is contained in:
larssand committed 2026-11-13 16:23:19 +01:00
1 parent da20a7e978
commit 6e45918e74
101 files changed
+2898 -45

No files matched your search

+6 -3
View File
@@ -1,3 +1,4 @@
import { flagHtml, countryChoices } from "./country_flags.js";
import { getDriverProfileGroups, getDriverProfileId, findTransponderConflict } from "./driver_profile_logic.js";
import { filterDrivers, sortDrivers, groupDriversByClass, removeDrivers, DRIVER_SORT_KEYS } from "./driver_list_logic.js";
@@ -434,10 +435,12 @@ export function renderDriversView(deps) {
const editingProfileId = editingDriver ? getDriverProfileId(editingDriver) : "";
const passingSoundOptions = (selected = "") => [`<option value="">${t("audio.pass_default")}</option>`, ...Array.from({ length: 8 }, (_item, index) => { const value = `pass_${String(index + 1).padStart(2, "0")}.wav`; return `<option value="${value}" ${selected === value ? "selected" : ""}>${value}</option>`; })].join("");
const existingClubs = [...new Set(state.drivers.map((driver) => String(driver.club || "").trim()).filter(Boolean))].sort();
// Every country with a flag, in the app's language; anything else typed before stays offered.
const flagLanguage = state.settings?.language === "en" ? "en" : "sv";
const existingCountries = [...new Set([
"Sverige", "Norge", "Finland", "Danmark", "Island", "Tyskland", "Nederländerna", "Belgien", "Frankrike", "Storbritannien", "Polen", "Tjeckien", "Österrike", "Schweiz",
...countryChoices(flagLanguage),
...state.drivers.map((driver) => String(driver.country || "").trim()).filter(Boolean),
])].sort();
])].sort((a, b) => a.localeCompare(b, flagLanguage));
dom.view.innerHTML = `
<section class="panel">
@@ -496,7 +499,7 @@ export function renderDriversView(deps) {
<td>${escapeHtml(d.name)}</td>
${showClass ? `<td>${escapeHtml(getClassName(d.classId))}</td>` : ""}
<td>${escapeHtml(profile?.club || d.club || "-")}</td>
<td>${escapeHtml(profile?.country || d.country || "-")}</td>
<td class="nowrap">${flagHtml(profile?.country || d.country, flagLanguage)}${escapeHtml(profile?.country || d.country || "-")}</td>
<td>${escapeHtml(d.brand || "-")}</td>
<td>${escapeHtml(d.transponder || "-")}</td>
<td>${escapeHtml(profile?.representative?.name || d.name)}${profile?.drivers.length > 1 ? ` · ${profile.drivers.length}` : ""}</td>