From b32a0cca577ecaff39c053dd9ce35de467870231 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 28 Jan 2025 13:46:32 +0100 Subject: [PATCH] Add /balance?up_incl= link to Booking edit views. --- templates/_macros.tmpl | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/templates/_macros.tmpl b/templates/_macros.tmpl index 7ae7845..55243af 100644 --- a/templates/_macros.tmpl +++ b/templates/_macros.tmpl @@ -54,23 +54,29 @@ td.invalid, tr.warning td.invalid { background-color: #ff0000; } {% macro taint_js() %} function taint() { - const els = document.getElementsByClassName("enable_on_change"); + let els = document.getElementsByClassName("enable_on_change"); for (let i = 0; i < els.length; i++) { els[i].disabled = false; } - const a = document.getElementById("switch_link"); - const link_text = a.textContent; - const span = a.parentNode; - span.innerHTML = ""; + let links_text = ''; + els = document.getElementsByClassName("disable_on_change"); + for (let i = 0; i < els.length; i++) { + links_text += els[i].textContent + ' '; + } + const span = document.getElementById('booking_links'); + span.innerHTML = ''; const del = document.createElement("del"); span.appendChild(del); - del.textContent = link_text; + del.textContent = links_text; } {% endmacro %} {% macro edit_bar(target, id) %} -switch to {{target}} + +switch to {{target}} +balance after +
{% endmacro %} -- 2.30.2