From 3ec79e1923dc6fcffcdaf3a107c18970a2cf3d33 Mon Sep 17 00:00:00 2001 From: Jose Lago Date: Sun, 17 May 2026 22:39:00 +0200 Subject: [PATCH] fix: update rental type label for consistency in multiple languages --- frontend/admin.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/frontend/admin.js b/frontend/admin.js index e4d3644..cfd7833 100644 --- a/frontend/admin.js +++ b/frontend/admin.js @@ -75,7 +75,25 @@ function notify(message, duration = 3000) { window.showToast(message, duration); return; } - alert(message); + showAdminToast(message, duration); +} + +function showAdminToast(message, duration = 3000) { + let toast = document.querySelector("#toast"); + if (!toast) { + toast = document.createElement("div"); + toast.id = "toast"; + toast.className = "toast"; + toast.setAttribute("role", "status"); + toast.setAttribute("aria-live", "polite"); + document.body.appendChild(toast); + } + + toast.textContent = message; + toast.classList.add("show"); + setTimeout(() => { + toast.classList.remove("show"); + }, duration); } // ========================================================================= @@ -580,7 +598,7 @@ async function renderLeadTab(tab, l) {
${lang === "de" ? t("adminDepositLabel") : t("adminDepositLabelEn")}€ ${deposit.toLocaleString("de-DE")}
${lang === "de" ? t("adminIncludedKmLabel") : t("adminIncludedKmLabelEn")}${(l.total_days || 0) * (state.vehicleMap.get(l.vehicle_id)?.included_km_per_day || 150)} km
${lang === "de" ? t("adminTotalDaysLabel") : t("adminTotalDaysLabelEn")}${l.total_days || 0}
-
${lang === "de" ? t("adminRentalType") : t("adminRentalTypeEn")}${esc(rental.label)}
+
${lang === "de" ? t("adminRentalType") : t("Rental type")}${esc(rental.label)}
`; } else if (tab === "documents") { const docs = await loadLeadAttachments(l.id); @@ -828,7 +846,7 @@ async function renderOrderTab(tab, o, id) {
${lang === "de" ? "Kunde" : "Customer"}
${cust ? `${esc(cust.name)} (${esc(cust.email)})` : esc(o.customer_id?.slice(0, 8) || "—")}
${lang === "de" ? "Fahrzeug" : "Vehicle"}
${esc(o.vehicle_label || "—")}
${lang === "de" ? "Zeitraum" : "Period"}
${esc(o.date_from || "—")} → ${esc(o.date_to || "—")}
-
${lang === "de" ? t("adminRentalType") : t("adminRentalTypeEn")}
${esc(rental.label)}
+
${lang === "de" ? t("adminRentalType") : t("Rental type")}
${esc(rental.label)}
${t("adminEmailSent")}
${emailSentText}
@@ -949,7 +967,7 @@ async function renderOrderTab(tab, o, id) {
${lang === "de" ? t("adminIncludedKmLabel") : t("adminIncludedKmLabelEn")}${days * (state.vehicleMap.get(o.vehicle_id)?.included_km_per_day || 150)} km
${lang === "de" ? t("adminTotalDaysLabel") : t("adminTotalDaysLabelEn")}${days}
-
${lang === "de" ? t("adminRentalType") : t("adminRentalTypeEn")}${esc(rental.label)}
+
${lang === "de" ? t("adminRentalType") : t("Rental type")}${esc(rental.label)}
${isIndividuell && !isEmailLocked ? `
` : ''}`;