Private
Public Access
1
0

start of UI for Analysis -> CP chart

This commit is contained in:
Sander Roosendaal
2020-10-11 13:47:44 +02:00
parent 49cbb57355
commit 88107530a5
3 changed files with 56 additions and 23 deletions

View File

@@ -16,14 +16,14 @@
<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();
@@ -32,8 +32,8 @@
hidden.show();
}
// 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.
@@ -48,10 +48,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:
@@ -67,7 +67,7 @@
<script>
// script for chart options form
$(function() {
// Get the form fields and hidden div
var functionfield = $("#id_function");
var plotfield = $("#id_plotfield").parent().parent();
@@ -82,14 +82,16 @@
var spmmax = $("#id_spmmax").parent().parent();
var workmin = $("#id_workmin").parent().parent();
var workmax = $("#id_workmax").parent().parent();
var xaxis = $("#id_xaxis").parent().parent();
var yaxis1 = $("#id_yaxis1").parent().parent();
var yaxis2 = $("#id_yaxis2").parent().parent();
var plottype = $("#id_plottype").parent().parent();
var xaxis = $("#id_xaxis").parent().parent();
var yaxis1 = $("#id_yaxis1").parent().parent();
var yaxis2 = $("#id_yaxis2").parent().parent();
var plottype = $("#id_plottype").parent().parent();
var reststrokes = $("#id_includereststrokes").parent().parent();
// 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.
plotfield.hide();
x_param.hide();
@@ -102,6 +104,7 @@
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.show();
if (functionfield.val() == 'boxplot') {
plotfield.show();
@@ -136,8 +139,8 @@
plottype.show();
}
// Setup an event listener for when the state of the
// Setup an event listener for when the state of the
// checkbox changes.
functionfield.change(function() {
// Check to see if the checkbox is checked.
@@ -161,6 +164,7 @@
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.show();
}
else if (Value=='histo') {
plotfield.show();
@@ -178,6 +182,7 @@
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.show();
}
else if (Value=='trendflex') {
@@ -196,6 +201,7 @@
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.show();
}
else if (Value=='flexall') {
@@ -214,6 +220,7 @@
binsize.hide();
plottype.hide();
errorbars.hide();
reststrokes.show();
}
else if (Value=='stats') {
xaxis.hide();
@@ -227,6 +234,7 @@
binsize.hide();
errorbars.hide();
plottype.hide();
reststrokes.show();
}
else if (Value=='compare') {
xaxis.show();
@@ -244,10 +252,29 @@
binsize.hide();
plottype.show();
errorbars.hide();
reststrokes.show();
}
else if (Value=='cp') {
plotfield.hide();
spmmin.hide();
spmmax.hide();
workmin.hide();
workmax.hide();
x_param.hide();
y_param.hide();
groupby.hide();
palette.hide();
binsize.hide();
errorbars.hide();
xaxis.hide();
yaxis1.hide();
yaxis2.hide();
plottype.hide();
reststrokes.hide();
}
});
});
});
</script>
<div id="id_css_res">
@@ -285,9 +312,9 @@
<input type="submit" value="GO"></input>
</form>
<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 }}