guidance added for plannedsession forms
This commit is contained in:
@@ -92,10 +92,14 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
<button class="button green small grid_2" type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div class="grid_6 prefix_6" id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -117,34 +121,72 @@
|
|||||||
$( myrow ).find('*[id*=sessionmode]').change(function() {
|
$( myrow ).find('*[id*=sessionmode]').change(function() {
|
||||||
if (this.value == 'TRIMP') {
|
if (this.value == 'TRIMP') {
|
||||||
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'distance') {
|
if (this.value == 'distance') {
|
||||||
$( myrow ).find("*[id*=sessionunit]").prop('value','m');
|
$( myrow ).find("*[id*=sessionunit]").prop('value','m');
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'time') {
|
if (this.value == 'time') {
|
||||||
$( myrow ).find("*[id*=sessionunit]").prop('value','min');
|
$( myrow ).find("*[id*=sessionunit]").prop('value','min');
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'rScore') {
|
if (this.value == 'rScore') {
|
||||||
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
$( myrow ).find("*[id*=sessionunit]").prop('value','None');
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$( myrow ).find('*[id*=sessionunit]').change(function() {
|
$( myrow ).find('*[id*=sessionunit]').change(function() {
|
||||||
if (this.value == 'km') {
|
if (this.value == 'km') {
|
||||||
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'm') {
|
if (this.value == 'm') {
|
||||||
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
$( myrow ).find("*[id*=sessionmode]").prop('value','distance');
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'None') {
|
if (this.value == 'None') {
|
||||||
$( myrow ).find("*[id*=sessionmode]").prop('value','rScore');
|
$( myrow ).find("*[id*=sessionmode]").prop('value','rScore');
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'min') {
|
if (this.value == 'min') {
|
||||||
$( myrow ).find("*[id*=sessionmode]").prop('value','time');
|
$( 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>
|
</script>
|
||||||
|
|||||||
@@ -124,6 +124,9 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="grid_6 prefix_6" id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
@@ -134,16 +137,20 @@
|
|||||||
|
|
||||||
if (this.value == 'TRIMP') {
|
if (this.value == 'TRIMP') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'distance') {
|
if (this.value == 'distance') {
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'time') {
|
if (this.value == 'time') {
|
||||||
$("td #id_sessionunit").prop("value","min");
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'rScore') {
|
if (this.value == 'rScore') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -152,18 +159,22 @@
|
|||||||
|
|
||||||
if (this.value == 'session') {
|
if (this.value == 'session') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'test') {
|
if (this.value == 'test') {
|
||||||
$("td #id_criterium").prop("value","exact");
|
$("td #id_criterium").prop("value","exact");
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #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>");
|
||||||
}
|
}
|
||||||
if (this.value == 'challenge') {
|
if (this.value == 'challenge') {
|
||||||
$("td #id_criterium").prop("value","minimum");
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'cycletarget') {
|
if (this.value == 'cycletarget') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -174,21 +185,27 @@
|
|||||||
|
|
||||||
if (this.value == 'm') {
|
if (this.value == 'm') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'km') {
|
if (this.value == 'km') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'None') {
|
if (this.value == 'None') {
|
||||||
$("td #id_sessionmode").prop("value","rScore");
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'min') {
|
if (this.value == 'min') {
|
||||||
$("td #id_sessionmode").prop("value","time");
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -124,6 +124,10 @@
|
|||||||
<div id="formbutton" class="grid_1 suffix_1 omega">
|
<div id="formbutton" class="grid_1 suffix_1 omega">
|
||||||
<input class="button green" type="submit" value="Save">
|
<input class="button green" type="submit" value="Save">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="grid_6" id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -139,16 +143,20 @@
|
|||||||
|
|
||||||
if (this.value == 'TRIMP') {
|
if (this.value == 'TRIMP') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'distance') {
|
if (this.value == 'distance') {
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'time') {
|
if (this.value == 'time') {
|
||||||
$("td #id_sessionunit").prop("value","min");
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'rScore') {
|
if (this.value == 'rScore') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -157,18 +165,22 @@
|
|||||||
|
|
||||||
if (this.value == 'session') {
|
if (this.value == 'session') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'test') {
|
if (this.value == 'test') {
|
||||||
$("td #id_criterium").prop("value","exact");
|
$("td #id_criterium").prop("value","exact");
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #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>");
|
||||||
}
|
}
|
||||||
if (this.value == 'challenge') {
|
if (this.value == 'challenge') {
|
||||||
$("td #id_criterium").prop("value","minimum");
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'cycletarget') {
|
if (this.value == 'cycletarget') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,15 +191,19 @@
|
|||||||
|
|
||||||
if (this.value == 'm') {
|
if (this.value == 'm') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'km') {
|
if (this.value == 'km') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'None') {
|
if (this.value == 'None') {
|
||||||
$("td #id_sessionmode").prop("value","rScore");
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'min') {
|
if (this.value == 'min') {
|
||||||
$("td #id_sessionmode").prop("value","time");
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -199,4 +215,5 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -116,6 +116,9 @@
|
|||||||
<input class="button green" type="submit" value="Save">
|
<input class="button green" type="submit" value="Save">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<div class="grid_6" id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -123,69 +126,84 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("td #id_sessionmode").change(function() {
|
$("td #id_sessionmode").change(function() {
|
||||||
|
|
||||||
if (this.value == 'TRIMP') {
|
|
||||||
$("td #id_sessionunit").prop("value","None");
|
|
||||||
}
|
|
||||||
if (this.value == 'distance') {
|
|
||||||
$("td #id_sessionunit").prop("value","m");
|
|
||||||
}
|
|
||||||
if (this.value == 'time') {
|
|
||||||
$("td #id_sessionunit").prop("value","min");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.value == 'rScore') {
|
|
||||||
$("td #id_sessionunit").prop("value","None");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$("td #id_sessiontype").change(function() {
|
|
||||||
|
|
||||||
if (this.value == 'session') {
|
|
||||||
$("td #id_criterium").prop("value","none");
|
|
||||||
}
|
|
||||||
if (this.value == 'test') {
|
|
||||||
$("td #id_criterium").prop("value","exact");
|
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
|
||||||
$("td #id_sessionunit").prop("value","m");
|
|
||||||
}
|
|
||||||
if (this.value == 'challenge') {
|
|
||||||
$("td #id_criterium").prop("value","minimum");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.value == 'cycletarget') {
|
|
||||||
$("td #id_criterium").prop("value","none");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
$("td #id_sessionunit").change(function() {
|
|
||||||
|
|
||||||
if (this.value == 'm') {
|
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
|
||||||
}
|
|
||||||
if (this.value == 'km') {
|
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
|
||||||
}
|
|
||||||
if (this.value == 'None') {
|
|
||||||
$("td #id_sessionmode").prop("value","rScore");
|
|
||||||
}
|
|
||||||
if (this.value == 'min') {
|
|
||||||
$("td #id_sessionmode").prop("value","time");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (this.value == 'TRIMP') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'distance') {
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'time') {
|
||||||
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'rScore') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("td #id_sessiontype").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'session') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'test') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$("td #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>");
|
||||||
|
}
|
||||||
|
if (this.value == 'challenge') {
|
||||||
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'cycletarget') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$("td #id_sessionunit").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'm') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'km') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'None') {
|
||||||
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'min') {
|
||||||
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -131,8 +131,12 @@
|
|||||||
<div id="formbutton" class="grid_1 suffix_1 omega">
|
<div id="formbutton" class="grid_1 suffix_1 omega">
|
||||||
<input class="button green" type="submit" value="Save">
|
<input class="button green" type="submit" value="Save">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
<div class="grid_6" id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -144,16 +148,20 @@
|
|||||||
|
|
||||||
if (this.value == 'TRIMP') {
|
if (this.value == 'TRIMP') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'distance') {
|
if (this.value == 'distance') {
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'time') {
|
if (this.value == 'time') {
|
||||||
$("td #id_sessionunit").prop("value","min");
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'rScore') {
|
if (this.value == 'rScore') {
|
||||||
$("td #id_sessionunit").prop("value","None");
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -162,18 +170,22 @@
|
|||||||
|
|
||||||
if (this.value == 'session') {
|
if (this.value == 'session') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'test') {
|
if (this.value == 'test') {
|
||||||
$("td #id_criterium").prop("value","exact");
|
$("td #id_criterium").prop("value","exact");
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
$("td #id_sessionunit").prop("value","m");
|
$("td #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>");
|
||||||
}
|
}
|
||||||
if (this.value == 'challenge') {
|
if (this.value == 'challenge') {
|
||||||
$("td #id_criterium").prop("value","minimum");
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.value == 'cycletarget') {
|
if (this.value == 'cycletarget') {
|
||||||
$("td #id_criterium").prop("value","none");
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -184,15 +196,19 @@
|
|||||||
|
|
||||||
if (this.value == 'm') {
|
if (this.value == 'm') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'km') {
|
if (this.value == 'km') {
|
||||||
$("td #id_sessionmode").prop("value","distance");
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'None') {
|
if (this.value == 'None') {
|
||||||
$("td #id_sessionmode").prop("value","rScore");
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
}
|
}
|
||||||
if (this.value == 'min') {
|
if (this.value == 'min') {
|
||||||
$("td #id_sessionmode").prop("value","time");
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11844,7 +11844,7 @@ def plannedsession_teamcreate_view(request,timeperiod='thisweek',
|
|||||||
'teamform':sessionteamselectform,
|
'teamform':sessionteamselectform,
|
||||||
'timeperiod':timeperiod,
|
'timeperiod':timeperiod,
|
||||||
'plannedsessions':sps,
|
'plannedsessions':sps,
|
||||||
'rower':r,
|
'rower':getrower(request.user),
|
||||||
})
|
})
|
||||||
|
|
||||||
# Manager edits sessions for entire team
|
# Manager edits sessions for entire team
|
||||||
|
|||||||
77
static/admin/js/plannedsessions.js
Normal file
77
static/admin/js/plannedsessions.js
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("td #id_sessionmode").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'TRIMP') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'distance') {
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'time') {
|
||||||
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'rScore') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("td #id_sessiontype").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'session') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'test') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$("td #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>");
|
||||||
|
}
|
||||||
|
if (this.value == 'challenge') {
|
||||||
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'cycletarget') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$("td #id_sessionunit").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'm') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'km') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'None') {
|
||||||
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'min') {
|
||||||
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
77
static/js/plannedsessions.js
Normal file
77
static/js/plannedsessions.js
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("td #id_sessionmode").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'TRIMP') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'distance') {
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'time') {
|
||||||
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'rScore') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("td #id_sessiontype").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'session') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'test') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$("td #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>");
|
||||||
|
}
|
||||||
|
if (this.value == 'challenge') {
|
||||||
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'cycletarget') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$("td #id_sessionunit").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'm') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'km') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'None') {
|
||||||
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'min') {
|
||||||
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user