start of UI for Analysis -> CP chart
This commit is contained in:
@@ -1036,6 +1036,7 @@ analysischoices = (
|
||||
('flexall','Cumulative Flex Chart'),
|
||||
('stats','Statistics'),
|
||||
('compare','Compare'),
|
||||
('cp','CP chart'),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -500,6 +500,9 @@ def histodata(workouts, options):
|
||||
|
||||
return(script,div)
|
||||
|
||||
def cpdata(workouts, options):
|
||||
return ('','Not Yet Implemented')
|
||||
|
||||
def statsdata(workouts, options):
|
||||
includereststrokes = options['includereststrokes']
|
||||
spmmin = options['spmmin']
|
||||
@@ -725,6 +728,8 @@ def analysis_view_data(request,userid=0):
|
||||
script,div = statsdata(workouts,options)
|
||||
elif function == 'compare':
|
||||
script,div = comparisondata(workouts,options)
|
||||
elif function == 'cp':
|
||||
script, div = cpdata(workouts, options)
|
||||
else:
|
||||
script = ''
|
||||
div = 'Unknown analysis functions'
|
||||
@@ -4849,7 +4854,7 @@ def history_view_data(request,userid=0):
|
||||
typeselect = 'All'
|
||||
|
||||
yaxis = request.GET.get('yaxis','duration')
|
||||
|
||||
|
||||
if yaxis.lower() not in ['duration','rscore','trimp']:
|
||||
yaxis = 'duration'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user