From 6628d8a57b1395dbb92b1f65741268f1024cc9ff Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 Jul 2025 18:59:02 +0100 Subject: [PATCH] Move export failed message to the title of the alert --- app/assets/javascripts/download_util.js | 2 +- app/assets/javascripts/osm.js.erb | 4 +++- app/views/layouts/_header.html.erb | 2 +- config/locales/en.yml | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/download_util.js b/app/assets/javascripts/download_util.js index 0aff1479f..db1e28323 100644 --- a/app/assets/javascripts/download_util.js +++ b/app/assets/javascripts/download_util.js @@ -32,7 +32,7 @@ OSM.getTurboBlobHandler = function (filename) { } function notifyExportFailure(reason) { - OSM.showAlert(OSM.i18n.t("javascripts.share.export_failed", { reason })); + OSM.showAlert(OSM.i18n.t("javascripts.share.export_failed_title"), reason); } return function ({ detail }) { diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index ae462940c..0287590fc 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -219,7 +219,9 @@ OSM = { return [...center, zoom, map.getLayersCode()].join("|"); }, - showAlert: function (message) { + showAlert: function (title, message) { + const modalTitle = document.getElementById("osm_alert_title"); + modalTitle.textContent = title; const modalBody = document.getElementById("osm_alert_message"); modalBody.textContent = message; const alertModal = new bootstrap.Modal(document.getElementById("osm_alert_modal")); diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 7bb27f737..583b830df 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -134,7 +134,7 @@