181 lines
4.5 KiB
HTML
181 lines
4.5 KiB
HTML
{% extends "newbase.html" %}
|
|
{% load static %}
|
|
{% load rowerfilters %}
|
|
|
|
{% block title %}Workouts{% endblock %}
|
|
|
|
{% block main %}
|
|
|
|
<script>
|
|
function toggle(source) {
|
|
checkboxes = document.querySelectorAll("input[name='workouts']");
|
|
for(var i=0, n=checkboxes.length;i<n;i++) {
|
|
checkboxes[i].checked = source.checked;
|
|
}
|
|
}
|
|
</script>
|
|
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
|
|
<script>
|
|
$( document ).ready(function() {
|
|
var boattypes = {
|
|
'1x': '1x (single)',
|
|
'2x': '2x (double)',
|
|
'2x+': '2x+ (coxed double)',
|
|
'2-': '2- (pair)',
|
|
'2+': '2+ (coxed pair)',
|
|
'3x+': '3x+ (coxed triple)',
|
|
'3x-': '3x- (triple)',
|
|
'4x': '4x (quad)',
|
|
'4x+': '4x+ (coxed quad)',
|
|
'4-': '4- (four)',
|
|
'4+': '4+ (coxed four)',
|
|
'8+': '8+ (eight)',
|
|
'8x+': '8x+ (octuple scull)',
|
|
}
|
|
|
|
var ergtypes = {
|
|
'static': 'Concept2 static',
|
|
'dynamic': 'Concept2 dynamic',
|
|
'slides': 'Concept2 slides',
|
|
'rp3': 'RP3',
|
|
'waterrower': 'Water Rower',
|
|
'other': 'Other Indoor Rower',
|
|
}
|
|
|
|
$('#id_modality').on('change', function(){
|
|
if (
|
|
$(this).val() == 'water'
|
|
|| $(this).val() == 'coastal'
|
|
|| $(this).val() == 'c-boat'
|
|
|| $(this).val() == 'churchboat'
|
|
) {
|
|
var $el = $('#id_waterboattype');
|
|
$el.empty();
|
|
$.each(boattypes, function(key,value) {
|
|
if ( key == '{{ workout.boattype }}') {
|
|
$el.append($("<option></option").attr("value", key).attr("selected", "selected").text(value));
|
|
} else {
|
|
$el.append($("<option></option").attr("value", key).text(value));
|
|
}
|
|
});
|
|
$el.toggle(true);
|
|
|
|
}
|
|
else if (
|
|
$(this).val() == 'rower'
|
|
) {
|
|
var $el = $('#id_waterboattype');
|
|
$el.empty();
|
|
$.each(ergtypes, function(key,value) {
|
|
if ( key == '{{ workout.boattype }}') {
|
|
$el.append($("<option></option").attr("value", key).attr("selected", "selected").text(value));
|
|
} else {
|
|
$el.append($("<option></option").attr("value", key).text(value));
|
|
}
|
|
});
|
|
$el.toggle(true);
|
|
}
|
|
else {
|
|
$('#id_waterboattype').toggle(false);
|
|
$('#id_waterboattype').val('1x');
|
|
}
|
|
if (
|
|
$(this).val() == 'rower'
|
|
|| $(this).val() == 'dynamic'
|
|
|| $(this).val() == 'slides'
|
|
) {
|
|
$('#id_dragfactor').toggle(true);
|
|
} else {
|
|
$('#id_dragfactor').toggle(false);
|
|
$('#id_dragfactor').val('0');
|
|
}
|
|
|
|
});
|
|
$('#id_modality').change();
|
|
});
|
|
</script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
console.log('kill parents')
|
|
$("#id_killparents").change(function() {
|
|
if (this.checked) {
|
|
$("#id_killparentswarning").html("<p><em>Warning: Deleted workouts cannot be recovered</em></p>");
|
|
};
|
|
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<h1>{{ team.name }} Glue Workouts</h1>
|
|
|
|
<ul class="main-content">
|
|
<li class="grid_4 maxheight">
|
|
{% if team %}
|
|
<form id="searchform" action="/rowers/workouts-join-select/team/{{ team.id }}/"
|
|
method="get" accept-charset="utf-8">
|
|
{% else %}
|
|
<form id="searchform" action="/rowers/workouts-join-select/"
|
|
method="get" accept-charset="utf-8">
|
|
{% endif %}
|
|
{{ searchform }}
|
|
<input type="submit" value="GO"></input>
|
|
</form>
|
|
</li>
|
|
<li class="grid_2 maxheight">
|
|
<form enctype="multipart/form-data" action="/rowers/workouts-join/" method="post">
|
|
{% if workouts %}
|
|
|
|
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
|
|
|
|
<table width="100%" class="listtable">
|
|
{{ form.as_table }}
|
|
</table>
|
|
|
|
{% else %}
|
|
<p> No workouts found </p>
|
|
{% endif %}
|
|
</li>
|
|
<li class="grid_2">
|
|
<p>Select two or more workouts on the left,
|
|
and press submit. Be careful with the "delete original workouts" option. Deleted
|
|
workouts cannot be recovered.</p>
|
|
<table>
|
|
{{ joinparamform.as_table }}
|
|
</table>
|
|
<div id="id_killparentswarning">
|
|
|
|
</div>
|
|
<p>
|
|
{% csrf_token %}
|
|
<input name='workoutselectform' type="submit" value="Submit">
|
|
</p>
|
|
</form>
|
|
</li>
|
|
<li class="grid_2">
|
|
<form enctype="multipart/form-data" action="" method="post">
|
|
<table>
|
|
{{ dateform.as_table }}
|
|
</table>
|
|
<table>
|
|
{{ modalityform.as_table }}
|
|
</table>
|
|
<p>
|
|
{% csrf_token %}
|
|
<input name='modalityform' type="submit" value="Filter Workouts">
|
|
</p>
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block sidebar %}
|
|
{% include 'menu_workouts.html' %}
|
|
{% endblock %}
|