Private
Public Access
1
0
Files
rowsandall/rowers/templates/empower_fix.html
2018-09-28 10:56:51 +02:00

137 lines
3.3 KiB
HTML

{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% block title %}Empower FIX{% 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>
$(function() {
// Get the form fields and hidden div
var modality = $("#id_modality");
var hidden = $("#id_waterboattype");
// Hide the fields.
// Use JS to do this in case the user doesn't have JS
// enabled.
hidden.hide();
// Setup an event listener for when the state of the
// checkbox changes.
modality.change(function() {
// Check to see if the checkbox is checked.
// If it is, show the fields and populate the input.
// If not, hide the fields.
var Value = modality.val();
if (Value=='water') {
// Show the hidden fields.
hidden.show();
} else {
// Make sure that the hidden fields are indeed
// hidden.
hidden.hide();
// You may also want to clear the value of the
// hidden fields here. Just in case somebody
// shows the fields, enters data to them and then
// unticks the checkbox.
//
// This would do the job:
//
// $("#hidden_field").val("");
}
});
});
</script>
<h1>Empower Workouts</h1>
<ul class="main-content">
<li class="grid_2">
<p>Use the date form to reduce the selection</p>
<p>
<form enctype="multipart/form-data" action="" method="post">
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
<input name='daterange' class="green button" type="submit" value="Submit">
</form>
</p>
</li>
<li class="grid_2">
<p>This functionality is aimed at users who have uploaded workouts from
the Nielsen-Kellerman Empower Oarlock/SpeedCoach combination before the
power inflation bug was known (May 4, 2018). </p>
<p>Workouts recorded with a SpeedCoach running NK Firmware version 2.17 or
lower have Power and Work per Stroke values that are approximately
9% (sculling) or 5% too high. The exact value of the error depends on your
inboard and oar length.</p>
<p>Currently, we autocorrect workouts recorded with old Firmware upon
their upload, but workouts that were present on the site before
the bug was known still have incorrect values for Power and Work per Stroke.
</p>
<p>
You can use this page to correct those workouts.
</p>
</li>
<li class="grid_4">
<p>
<form enctype="multipart/form-data" action="" method="post">
{% if workouts %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
<table width="100%" class="listtable">
{{ form.as_table }}
</table>
{% csrf_token %}
<input name='workoutselectform' class="button green" type="submit" value="Submit">
</form>
</p>
{% else %}
<p> No workouts found </p>
{% endif %}
</li>
{% if workouts %}
<li>
<p>Select workouts
and press submit
</p>
</li>
{% endif %}
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_workouts.html' %}
{% endblock %}