trabajando en el wizard del presupuesto

This commit is contained in:
2025-10-09 15:40:42 +02:00
parent 2b53579a48
commit 328ff509e3
9 changed files with 173 additions and 26 deletions

View File

@ -22,7 +22,7 @@
if (!lang || lang === getCurrentLang()) return;
// Guarda la preferencia (opcional)
try { localStorage.setItem("language", lang); } catch {}
try { localStorage.setItem("language", lang); } catch { }
// Redirige con ?lang=... para que Spring cambie el Locale y renderice en ese idioma
const url = new URL(location.href);
@ -48,6 +48,22 @@
url.searchParams.set("lang", saved);
location.replace(url); // alinea y no deja historial extra
}
initsAlert();
}
function initsAlert() {
var alerts = document.querySelectorAll('.alert.alert-dismissible');
alerts.forEach(function (el) {
// Solo si está visible
if (el.classList.contains('show')) {
setTimeout(function () {
// Usa la API de Bootstrap para cerrar con transición
var bsAlert = bootstrap.Alert.getOrCreateInstance(el);
bsAlert.close();
}, 5000);
}
});
}
document.addEventListener("DOMContentLoaded", initLanguage);

View File

@ -66,6 +66,13 @@
],
});
$('#presupuestos-anonimos-datatable').on('click', '.btn-edit-anonimo', function (e) {
e.preventDefault();
const id = $(this).data('id');
if (id) {
window.location.href = '/presupuesto/view/' + id;
}
});
})();