toggle multiple check boxes
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<script src="/static/cookielaw/js/cookielaw.js"></script>
|
<script src="/static/cookielaw/js/cookielaw.js"></script>
|
||||||
{% analytical_head_top %}
|
{% analytical_head_top %}
|
||||||
{% if GOOGLE_ANALYTICS_PROPERTY_ID %}
|
{% if GOOGLE_ANALYTICS_PROPERTY_ID %}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
};
|
};
|
||||||
window.addEventListener('load', plot_resize_setup);
|
window.addEventListener('load', plot_resize_setup);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
|
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
|
||||||
html, body {height: 100%; margin:5px;}
|
html, body {height: 100%; margin:5px;}
|
||||||
|
|||||||
@@ -6,6 +6,15 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function toggle(source) {
|
||||||
|
checkboxes = document.querySelectorAll("input[type='checkbox']");
|
||||||
|
for(var i=0, n=checkboxes.length;i<n;i++) {
|
||||||
|
checkboxes[i].checked = source.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<div class="grid_12 alpha">
|
<div class="grid_12 alpha">
|
||||||
{% include "teambuttons.html" with teamid=team.id team=team %}
|
{% include "teambuttons.html" with teamid=team.id team=team %}
|
||||||
@@ -58,10 +67,12 @@
|
|||||||
|
|
||||||
{% if workouts %}
|
{% if workouts %}
|
||||||
|
|
||||||
|
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
|
||||||
|
|
||||||
<table width="100%" class="listtable">
|
<table width="100%" class="listtable">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p> No workouts found </p>
|
<p> No workouts found </p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -5,6 +5,14 @@
|
|||||||
{% block title %}Workouts{% endblock %}
|
{% block title %}Workouts{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<script>
|
||||||
|
function toggle(source) {
|
||||||
|
checkboxes = document.querySelectorAll("input[type='checkbox']");
|
||||||
|
for(var i=0, n=checkboxes.length;i<n;i++) {
|
||||||
|
checkboxes[i].checked = source.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
{% if team %}
|
{% if team %}
|
||||||
@@ -76,7 +84,7 @@
|
|||||||
|
|
||||||
{% if workouts %}
|
{% if workouts %}
|
||||||
|
|
||||||
|
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
|
||||||
<table width="100%" class="listtable">
|
<table width="100%" class="listtable">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user