{% 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) %}
<input class="enable_on_change" type="submit" name="apply" value="apply" disabled />
<input class="enable_on_change" type="submit" name="revert" value="revert" disabled />
-<span><a id="switch_link" href="/edit_{{target}}/{{id}}">switch to {{target}}</a></span>
+<span id="booking_links">
+<a class="disable_on_change" href="/edit_{{target}}/{{id}}">switch to {{target}}</a>
+<a class="disable_on_change" href="/balance?up_incl={{id}}">balance after</a>
+</span>
<hr />
{% endmacro %}