From: Christian Heller Date: Tue, 28 Jan 2025 18:17:36 +0000 (+0100) Subject: Improve Booking editing links bar layout. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bprefix%7D%7D/calendar?a=commitdiff_plain;h=826f88de017f5ed29162692a20bf83d10384d4fc;p=plomledger Improve Booking editing links bar layout. --- diff --git a/templates/_macros.tmpl b/templates/_macros.tmpl index 3619472..a899699 100644 --- a/templates/_macros.tmpl +++ b/templates/_macros.tmpl @@ -59,15 +59,16 @@ function taint() { el.disabled = false; }); // deactivate Booking links - let links_text = ''; - Array.from(document.getElementsByClassName("disable_on_change")).forEach((el) => { - links_text += el.textContent + ' '; + Array.from(document.getElementsByClassName("disable_on_change")).forEach((span) => { + let links_text = ''; + Array.from(span.childNodes).forEach((node) => { + links_text += node.textContent + ' '; + }); + span.innerHTML = ''; + const del = document.createElement("del"); + span.appendChild(del); + del.textContent = links_text; }); - const span = document.getElementById('booking_links'); - span.innerHTML = ''; - const del = document.createElement("del"); - span.appendChild(del); - del.textContent = links_text; // remove oninput handlers no longer needed (since we only ever go one way) ['input', 'textarea'].forEach((tag_name) => { Array.from(document.getElementsByTagName(tag_name)).forEach((el) => { @@ -78,13 +79,13 @@ function taint() { {% endmacro %} {% macro edit_bar(target, id) %} + +prev · next + - -switch to {{target}} -balance after -prev -next + +switch to {{target}} · balance after
{% endmacro %}