131 lines
3.2 KiB
HTML
131 lines
3.2 KiB
HTML
{% extends "newbase.html" %}
|
|
{% load static %}
|
|
{% load rowerfilters %}
|
|
{% load tz %}
|
|
|
|
|
|
{% get_current_timezone as TIME_ZONE %}
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script type='text/javascript'
|
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.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_workouttype').on('change', function(){
|
|
if (
|
|
$(this).val() == 'water'
|
|
|| $(this).val() == 'coastal'
|
|
|| $(this).val() == 'c-boat'
|
|
|| $(this).val() == 'churchboat'
|
|
) {
|
|
var $el = $('#id_boattype');
|
|
$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_boattype');
|
|
$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_boattype').toggle(false);
|
|
$('#id_boattype').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_workouttype').change();
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
<h1>Add Manual Workout Entry</h1>
|
|
<ul class="main-content">
|
|
<li class="grid_2">
|
|
{% if form.errors %}
|
|
<p style="color: red;">
|
|
Please correct the error{{ form.errors|pluralize }} below.
|
|
</p>
|
|
{% endif %}
|
|
|
|
<form id="importantform"
|
|
enctype="multipart/form-data" action="" method="post">
|
|
<table width=100%>
|
|
{{ form.as_table }}
|
|
{{ metricsform.as_table }}
|
|
</table>
|
|
Optional, add image (PM screenshot, for example as evidence for a virtual race):
|
|
<table>
|
|
{{ iform.as_table }}
|
|
</table>
|
|
{% csrf_token %}
|
|
<p>
|
|
<input class="button green" type="submit" value="Save">
|
|
</p>
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
{% include 'menu_workouts.html' %}
|
|
{% endblock %}
|