Private
Public Access
1
0

adding unfold/fold all checkbox in trainingplan view

This commit is contained in:
Sander Roosendaal
2018-11-12 12:08:56 +01:00
parent dae9c80f6f
commit 15555402d2

View File

@@ -6,6 +6,17 @@
{% block main %}
<script>
function toggle(source) {
checkboxes = document.querySelectorAll("input[type='checkbox']");
for (var i=0, n=checkboxes.length;i<n;i++) {
if (checkboxes[i].name.includes('selector')) {
checkboxes[i].checked = source.checked
}
}
}
</script>
<h1>Training Plan - {{ plan.name }}</h1>
<p>This plan starts on {{ plan.startdate }} and ends on {{ plan.enddate }}.
{% if plan.target %}
@@ -18,6 +29,7 @@
<h2>Plan Macro, Meso and Micro Cycles</h2>
<p><input type="checkbox" href="" onClick="toggle(this)" />Unfold/Fold all</p>
<ul class="cd-accordion-menu animated">
<!-- Start Macrocycle For Loop -->
{% for key, macrocycle in cycles.items %}