Private
Public Access
1
0

improved workout edit form

This commit is contained in:
Sander Roosendaal
2018-06-08 08:47:55 +02:00
parent 358913f250
commit 229145679a
3 changed files with 39 additions and 42 deletions

View File

@@ -17,6 +17,27 @@
{% include "monitorjobs.html" %}
<script type='text/javascript'
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>
$( document ).ready(function() {
$('#id_workouttype').on('change', function(){
if (
$(this).val() == 'rower'
|| $(this).val() == 'skierg'
|| $(this).val() == 'dynamic'
|| $(this).val() == 'sliders'
|| $(this).val() == 'paddle'
|| $(this).val() == 'snow'
) {
$('#id_boattype').toggle(false);
$('#id_boattype').val('1x');
} else {
$('#id_boattype').toggle(true);
}
});
$('#id_workouttype').change();
});
</script>
{% endblock %}
@@ -107,16 +128,7 @@
{{ form.as_table }}
</table>
{% csrf_token %}
<div class="grid_2 prefix_2 alpha tooltip">
{% if workout.privacy == 'visible' %}
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/setprivate">Set Private</a>
<span class="tooltiptext">Only you can see this workout</span>
{% else %}
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/makepublic">Make Public</a>
<span class="tooltiptext">Make this workout visible to your teams and followers</span>
{% endif %}
</div>
<div id="formbutton" class="grid_1 suffix_1 omega">
<div id="formbutton" class="grid_1 prefix_2 suffix_1 omega">
<input class="button green" type="submit" value="Save">
</div>
</form>