guidance added for plannedsession forms
This commit is contained in:
@@ -92,10 +92,14 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="button gray small grid_2" href="/rowers/sessions/multicreate/thisweek/rower/{{ rower.id }}/extra/{{ extrasessions }}">Add More</a>
|
||||
<a class="button gray small grid_2" href="/rowers/sessions/multicreate/{{ timeperiod }}/rower/{{ rower.id }}/extra/{{ extrasessions }}">Add More</a>
|
||||
<button class="button green small grid_2" type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<div class="grid_6 prefix_6" id="id_guidance">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -117,34 +121,72 @@
|
||||
$( myrow ).find('*[id*=sessionmode]').change(function() {
|
||||
if (this.value == 'TRIMP') {
|
||||
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
||||
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||
}
|
||||
if (this.value == 'distance') {
|
||||
$( myrow ).find("*[id*=sessionunit]").prop('value','m');
|
||||
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||
}
|
||||
if (this.value == 'time') {
|
||||
$( myrow ).find("*[id*=sessionunit]").prop('value','min');
|
||||
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||
}
|
||||
if (this.value == 'rScore') {
|
||||
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
||||
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$( myrow ).find('*[id*=sessionunit]').change(function() {
|
||||
if (this.value == 'km') {
|
||||
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
||||
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||
}
|
||||
if (this.value == 'm') {
|
||||
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
||||
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||
}
|
||||
if (this.value == 'None') {
|
||||
$( myrow ).find("*[id*=sessionmode]").prop('value','rScore');
|
||||
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||
}
|
||||
if (this.value == 'min') {
|
||||
$( myrow ).find("*[id*=sessionmode]").prop('value','time');
|
||||
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||
}
|
||||
});
|
||||
|
||||
$( myrow ).find('*[id*=sessiontype]').change(function() {
|
||||
if (this.value == 'session') {
|
||||
$( myrow ).find("*[id*=criterium]").prop("value","none");
|
||||
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||
}
|
||||
|
||||
if (this.value == 'challenge') {
|
||||
$( myrow ).find("*[id*=criterium]").prop("value","minimum");
|
||||
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||
}
|
||||
|
||||
if (this.value == 'cycletarget') {
|
||||
$( myrow ).find("*[id*=criterium]").prop("value","none");
|
||||
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||
}
|
||||
|
||||
if (this.value == 'test') {
|
||||
$( myrow ).find("*[id*=criterium]").prop("value","exact");
|
||||
$( myrow ).find("*[id*=sessionmode]").prop("value","distance");
|
||||
$( myrow ).find("*[id*=sessionunit]").prop("value","m");
|
||||
$('#id_guidance').html("<p>Set mode to distance. For Mandatory Tests, only distance or time are allowed.</p><p>For Mandatory Tests, the only criterium is 'Exactly'</p>");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user