Private
Public Access
1
0

Merge branch 'release/v9.85'

This commit is contained in:
Sander Roosendaal
2019-05-04 20:28:38 +02:00
10 changed files with 82 additions and 9 deletions
+1 -2
View File
@@ -1273,8 +1273,7 @@ def new_workout_from_file(r, f2,
message = None
try:
fileformat = get_file_type(f2)
print(fileformat,'aa')
except IOError:
except (IOError,UnicodeDecodeError):
os.remove(f2)
message = "Rowsandall could not process this file. The extension is supported but the file seems corrupt. Contact info@rowsandall.com if you think this is incorrect."
return (0, message, f2)
+7 -1
View File
@@ -843,6 +843,7 @@ analysischoices = (
('histo','Histogram'),
('flexall','Cumulative Flex Chart'),
('stats','Statistics'),
('compare','Compare'),
)
@@ -859,7 +860,11 @@ class AnalysisChoiceForm(forms.Form):
yaxchoices = dict((x,y) for x,y in yaxchoices)
yaxchoices = list(sorted(yaxchoices.items(), key = lambda x:x[1]))
plotchoices = (
('line','Line Plot'),
('scatter','Scatter Plot'),
)
yaxchoices2 = list(
(ax[0],ax[1]) for ax in axes if ax[0] not in ['cumdist','distance','time']
)
@@ -874,6 +879,7 @@ class AnalysisChoiceForm(forms.Form):
choices=yaxchoices,label='Left Axis',required=True,initial='power')
yaxis2 = forms.ChoiceField(
choices=yaxchoices2,label='Right Axis',required=True,initial='None')
plottype = forms.ChoiceField(choices=plotchoices,initial='scatter')
plotfield = forms.ChoiceField(choices=parchoices,initial='spm',
label='Metric')
+4
View File
@@ -131,6 +131,10 @@ class RowerPlanMiddleWare(object):
messages.error(request,messg)
r = getrower(request.user)
r.rowerplan = 'basic'
r.paymenttype = 'single'
basicplans = PaidPlan.objects.filter(shortname='basic',price=0,
paymentprocessor='braintree')
r.paidplan = basicplans[0]
r.save()
# send email
job = myqueue(queue,
+1 -1
View File
@@ -227,7 +227,7 @@
</tr>
<tr>
<td>
Available upgrades
Available <a href="/rowers/upgrade/">upgrades</a>
</td>
<td>
&nbsp;
@@ -10,7 +10,7 @@
{% if recurring=='recurring' %}
<p>
Your next charge is due on {{ end_of_billing_period }}. We will charge your {{ paymentmethod }}
Your next charge is due on {{ end_of_billing_period }}. We will charge you
on that date.
</p>
@@ -85,6 +85,7 @@
var xaxis = $("#id_xaxis").parent().parent();
var yaxis1 = $("#id_yaxis1").parent().parent();
var yaxis2 = $("#id_yaxis2").parent().parent();
var plottype = $("#id_plottype").parent().parent();
// Hide the fields.
// Use JS to do this in case the user doesn't have JS
@@ -99,6 +100,7 @@
xaxis.hide();
yaxis1.hide();
yaxis2.hide();
plottype.hide();
if (functionfield.val() == 'boxplot') {
plotfield.show();
@@ -127,6 +129,12 @@
plotfield.hide();
}
if (functionfield.val() == 'compare') {
xaxis.show();
yaxis1.show();
plottype.show();
}
// Setup an event listener for when the state of the
// checkbox changes.
@@ -151,6 +159,7 @@
xaxis.hide();
yaxis1.hide();
yaxis2.hide();
plottype.hide();
}
else if (Value=='histo') {
plotfield.show();
@@ -167,6 +176,7 @@
xaxis.hide();
yaxis1.hide();
yaxis2.hide();
plottype.hide();
}
else if (Value=='trendflex') {
@@ -184,6 +194,7 @@
xaxis.hide();
yaxis1.hide();
yaxis2.hide();
plottype.hide();
}
else if (Value=='flexall') {
@@ -200,6 +211,7 @@
plotfield.hide();
palette.hide();
binsize.hide();
plottype.hide();
errorbars.hide();
}
else if (Value=='stats') {
@@ -213,6 +225,24 @@
palette.hide();
binsize.hide();
errorbars.hide();
plottype.hide();
}
else if (Value=='compare') {
xaxis.show();
yaxis1.show();
yaxis2.hide();
x_param.hide();
y_param.hide();
groupby.hide();
spmmin.hide();
spmmax.hide();
workmin.hide();
workmax.hide();
plotfield.hide();
palette.hide();
binsize.hide();
plottype.show();
errorbars.hide();
}
});
});
Binary file not shown.
+6 -3
View File
@@ -493,9 +493,12 @@ def get_strava_stream(r,metric,stravaid,series_type='time',fetchresolution='high
for data in s.json():
y = None
if data['type'] == metric:
return np.array(data['data'])
try:
if data['type'] == metric:
return np.array(data['data'])
except TypeError:
return None
return None
def allmonths(startdate,enddate):
+31
View File
@@ -545,6 +545,35 @@ def statsdata(workouts, options):
return('',html_content)
def comparisondata(workouts,options):
includereststrokes = options['includereststrokes']
xparam = options['xaxis']
yparam1 = options['yaxis1']
plottype = options['plottype']
promember=True
workstrokesonly = not includereststrokes
ids = [w.id for w in workouts]
labeldict = {
int(w.id): w.__str__() for w in workouts
}
res = interactive_multiple_compare_chart(ids,xparam,yparam1,
promember=promember,
plottype=plottype,
labeldict=labeldict)
script = res[0]
div = res[1]
scripta = script.split('\n')[2:-1]
script = ''.join(scripta)
return(script,div)
def boxplotdata(workouts,options):
includereststrokes = options['includereststrokes']
@@ -656,6 +685,8 @@ def analysis_view_data(request,userid=0):
script,div = flexalldata(workouts,options)
elif function == 'stats':
script,div = statsdata(workouts,options)
elif function == 'compare':
script,div = comparisondata(workouts,options)
else:
script = ''
div = 'Unknown analysis functions'
+1 -1
View File
@@ -1874,7 +1874,7 @@ def workout_downloadmetar_view(request,id=0,
try:
row.notes += "\n"+message
except TypeError:
if message:
if message is not None:
row.notes += message
row.save()