Private
Public Access
1
0

added option to kill parents with join workouts

This commit is contained in:
Sander Roosendaal
2020-05-13 08:06:45 +02:00
parent d2a810c873
commit 748f12e44a
4 changed files with 36 additions and 15 deletions

View File

@@ -17,21 +17,21 @@
<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
// 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
// Setup an event listener for when the state of the
// checkbox changes.
modality.change(function() {
// Check to see if the checkbox is checked.
@@ -45,10 +45,10 @@
// 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
// 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:
@@ -60,12 +60,20 @@
});
$(document).ready(function(){
console.log('kill parents')
$("#id_killparents").change(function() {
if (this.checked) {
$("#id_killparentswarning").html("<p><em>Warning: Deleted workouts cannot be recovered</em></p>");
};
});
});
</script>
<h1>{{ team.name }} Glue Workouts</h1>
<ul class="main-content">
@@ -76,7 +84,7 @@
{% else %}
<form id="searchform" action="/rowers/workouts-join-select/"
method="get" accept-charset="utf-8">
{% endif %}
{% endif %}
{{ searchform }}
<input type="submit" value="GO"></input>
</form>
@@ -84,7 +92,7 @@
<li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/workouts-join/" method="post">
{% if workouts %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
<table width="100%" class="listtable">
@@ -97,10 +105,14 @@
</li>
<li class="grid_2">
<p>Select two or more workouts on the left,
and press submit</p>
and press submit. Be careful with the "delete original workouts" option. Deleted
workouts cannot be recovered.</p>
<table>
{{ joinparamform.as_table }}
</table>
<div id="id_killparentswarning">
</div>
<p>
{% csrf_token %}
<input name='workoutselectform' type="submit" value="Submit">
@@ -127,6 +139,7 @@
{% endblock %}
{% block sidebar %}
{% include 'menu_workouts.html' %}
{% endblock %}