landing: harden GOA alt display for all three sites

Ship goa-amount.js inside each landing tree, add an inline fallback when
the asset is not yet deployed, keep CHF free of GOA unit names, fix
exchange amount_full wiring, and add test-landing-stats.sh (local + live).
This commit is contained in:
Hernâni Marques 2026-07-17 08:48:00 +02:00
parent b65018cd0b
commit 9e0f85024b
No known key found for this signature in database
10 changed files with 796 additions and 16 deletions

View file

@ -813,6 +813,33 @@ sudo apt-get install -y taler-wallet-cli</pre>
</main>
<script src="/intro/goa-amount.js"></script>
<script>
/* Fallback if goa-amount.js not yet deployed (uses amount_alt from stats.json) */
(function () {
if (window.GoaAmount) return;
window.GoaAmount = {
rememberAlt: function () {},
format: function (a) {
var s = a == null || a === "" ? "—" : String(a);
return { display: s, title: s === "—" ? "" : s, raw: s, usedAlt: false };
},
pick: function (row) {
if (row && typeof row === "object") {
if (row.amount_alt) {
return {
display: String(row.amount_alt),
title: String(row.amount_full || row.amount || row.amount_alt),
raw: String(row.amount || ""),
usedAlt: true
};
}
return this.format(row.amount || row.amount_paid_sum || row.amount_sum || "—");
}
return this.format(row);
}
};
})();
</script>
<script>
(function () {
function set(id, v) {
var el = document.getElementById(id);