Merge branch 'feature/embeddedvideo' of https://bitbucket.org/sanderroosendaal/rowsandall into feature/embeddedvideo
This commit is contained in:
@@ -20,7 +20,7 @@ from rowers.tasks import (
|
|||||||
handle_send_email_subscription_create,
|
handle_send_email_subscription_create,
|
||||||
handle_send_email_failed_cancel,
|
handle_send_email_failed_cancel,
|
||||||
)
|
)
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from rowsandall_app.settings import (
|
from rowsandall_app.settings import (
|
||||||
@@ -70,7 +70,7 @@ def create_customer(rower,force=False):
|
|||||||
else:
|
else:
|
||||||
return rower.customer_id
|
return rower.customer_id
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_client_token(rower):
|
def get_client_token(rower):
|
||||||
try:
|
try:
|
||||||
@@ -79,10 +79,10 @@ def get_client_token(rower):
|
|||||||
})
|
})
|
||||||
except ValueError:
|
except ValueError:
|
||||||
customer_id = create_customer(rower,force=True)
|
customer_id = create_customer(rower,force=True)
|
||||||
|
|
||||||
client_token = gateway.client_token.generate({
|
client_token = gateway.client_token.generate({
|
||||||
"customer_id": customer_id,
|
"customer_id": customer_id,
|
||||||
})
|
})
|
||||||
|
|
||||||
return client_token
|
return client_token
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ def get_plans_costs():
|
|||||||
plans = gateway.plan.all()
|
plans = gateway.plan.all()
|
||||||
|
|
||||||
localplans = PaidPlan.object.filter(paymentprocessor='braintree')
|
localplans = PaidPlan.object.filter(paymentprocessor='braintree')
|
||||||
|
|
||||||
for plan in localplans:
|
for plan in localplans:
|
||||||
for btplan in btplans:
|
for btplan in btplans:
|
||||||
if int(btplan.id) == plan.external_id:
|
if int(btplan.id) == plan.external_id:
|
||||||
@@ -108,7 +108,7 @@ def make_payment(rower,data):
|
|||||||
|
|
||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
amount = '{amount:.f2}'.format(amount=amount)
|
amount = '{amount:.f2}'.format(amount=amount)
|
||||||
|
|
||||||
result = gateway.transaction.sale({
|
result = gateway.transaction.sale({
|
||||||
"amount": amount,
|
"amount": amount,
|
||||||
"payment_method_nonce": nonce_from_the_client,
|
"payment_method_nonce": nonce_from_the_client,
|
||||||
@@ -123,7 +123,7 @@ def make_payment(rower,data):
|
|||||||
f = rower.user.first_name,
|
f = rower.user.first_name,
|
||||||
l = rower.user.last_name,
|
l = rower.user.last_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
job = myqueue(queuehigh,handle_send_email_transaction,
|
job = myqueue(queuehigh,handle_send_email_transaction,
|
||||||
name, rower.user.email, amount)
|
name, rower.user.email, amount)
|
||||||
@@ -143,7 +143,7 @@ def update_subscription(rower,data,method='up'):
|
|||||||
amount = data['amount']
|
amount = data['amount']
|
||||||
amount = '{amount:.2f}'.format(amount=amount)
|
amount = '{amount:.2f}'.format(amount=amount)
|
||||||
|
|
||||||
|
|
||||||
gatewaydata = {
|
gatewaydata = {
|
||||||
"price": amount,
|
"price": amount,
|
||||||
"plan_id": plan.external_id,
|
"plan_id": plan.external_id,
|
||||||
@@ -192,7 +192,7 @@ def update_subscription(rower,data,method='up'):
|
|||||||
coachgroup.save()
|
coachgroup.save()
|
||||||
rower.mycoachgroup = coachgroup
|
rower.mycoachgroup = coachgroup
|
||||||
rower.save()
|
rower.save()
|
||||||
|
|
||||||
athletes = Rower.objects.filter(coachinggroups__in=[rower.mycoachgroup]).distinct()
|
athletes = Rower.objects.filter(coachinggroups__in=[rower.mycoachgroup]).distinct()
|
||||||
for athlete in athletes:
|
for athlete in athletes:
|
||||||
athlete.coachinggroups.remove(rower.mycoachgroup)
|
athlete.coachinggroups.remove(rower.mycoachgroup)
|
||||||
@@ -217,7 +217,7 @@ def update_subscription(rower,data,method='up'):
|
|||||||
amount,
|
amount,
|
||||||
result.subscription.billing_period_end_date.strftime('%Y-%m-%d'),
|
result.subscription.billing_period_end_date.strftime('%Y-%m-%d'),
|
||||||
method)
|
method)
|
||||||
|
|
||||||
return True,amount
|
return True,amount
|
||||||
else:
|
else:
|
||||||
errors = result.errors.for_object("subscription")
|
errors = result.errors.for_object("subscription")
|
||||||
@@ -230,12 +230,12 @@ def update_subscription(rower,data,method='up'):
|
|||||||
|
|
||||||
if create_new:
|
if create_new:
|
||||||
return create_subscription(rower,data)
|
return create_subscription(rower,data)
|
||||||
|
|
||||||
return False,0
|
return False,0
|
||||||
|
|
||||||
return False,0
|
return False,0
|
||||||
|
|
||||||
|
|
||||||
def create_subscription(rower,data):
|
def create_subscription(rower,data):
|
||||||
nonce_from_the_client = data['payment_method_nonce']
|
nonce_from_the_client = data['payment_method_nonce']
|
||||||
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
nonce = gateway.payment_method_nonce.find(nonce_from_the_client)
|
||||||
@@ -249,8 +249,8 @@ def create_subscription(rower,data):
|
|||||||
|
|
||||||
planid = data['plan']
|
planid = data['plan']
|
||||||
plan = PaidPlan.objects.get(id=planid)
|
plan = PaidPlan.objects.get(id=planid)
|
||||||
|
|
||||||
|
|
||||||
# create or find payment method
|
# create or find payment method
|
||||||
result = gateway.payment_method.create({
|
result = gateway.payment_method.create({
|
||||||
"customer_id": rower.customer_id,
|
"customer_id": rower.customer_id,
|
||||||
@@ -270,6 +270,7 @@ def create_subscription(rower,data):
|
|||||||
|
|
||||||
|
|
||||||
if result.is_success:
|
if result.is_success:
|
||||||
|
yesterday = (timezone.now()-datetime.timedelta(days=1)).date()
|
||||||
rower.paidplan = plan
|
rower.paidplan = plan
|
||||||
rower.planexpires = result.subscription.billing_period_end_date
|
rower.planexpires = result.subscription.billing_period_end_date
|
||||||
rower.teamplanexpires = result.subscription.billing_period_end_date
|
rower.teamplanexpires = result.subscription.billing_period_end_date
|
||||||
@@ -277,6 +278,8 @@ def create_subscription(rower,data):
|
|||||||
rower.paymenttype = plan.paymenttype
|
rower.paymenttype = plan.paymenttype
|
||||||
rower.rowerplan = plan.shortname
|
rower.rowerplan = plan.shortname
|
||||||
rower.subscription_id = result.subscription.id
|
rower.subscription_id = result.subscription.id
|
||||||
|
rower.protrialexpires = yesterday
|
||||||
|
rower.plantrialexpires = yesterday
|
||||||
|
|
||||||
rower.save()
|
rower.save()
|
||||||
name = '{f} {l}'.format(
|
name = '{f} {l}'.format(
|
||||||
@@ -286,7 +289,7 @@ def create_subscription(rower,data):
|
|||||||
|
|
||||||
|
|
||||||
recurring = plan.paymenttype
|
recurring = plan.paymenttype
|
||||||
|
|
||||||
job = myqueue(
|
job = myqueue(
|
||||||
queuehigh,
|
queuehigh,
|
||||||
handle_send_email_subscription_create,
|
handle_send_email_subscription_create,
|
||||||
@@ -312,15 +315,15 @@ def cancel_subscription(rower,id):
|
|||||||
themessages.append("Subscription canceled")
|
themessages.append("Subscription canceled")
|
||||||
except:
|
except:
|
||||||
errormessages.append("We could not find the subscription record in our customer database. We have notified the site owner, who will contact you.")
|
errormessages.append("We could not find the subscription record in our customer database. We have notified the site owner, who will contact you.")
|
||||||
|
|
||||||
|
|
||||||
name = '{f} {l}'.format(f = rower.user.first_name, l = rower.user.last_name)
|
name = '{f} {l}'.format(f = rower.user.first_name, l = rower.user.last_name)
|
||||||
|
|
||||||
|
|
||||||
job = myqueue(queuehigh,
|
job = myqueue(queuehigh,
|
||||||
handle_send_email_failed_cancel,
|
handle_send_email_failed_cancel,
|
||||||
name, rower.user.email,rower.user.username,id)
|
name, rower.user.email,rower.user.username,id)
|
||||||
|
|
||||||
return False, themessages, errormessages
|
return False, themessages, errormessages
|
||||||
|
|
||||||
basicplans = PaidPlan.objects.filter(price=0,paymentprocessor='braintree')
|
basicplans = PaidPlan.objects.filter(price=0,paymentprocessor='braintree')
|
||||||
@@ -343,7 +346,7 @@ def find_subscriptions(rower):
|
|||||||
raise ProcessorCustomerError("We could not find the customer in the database")
|
raise ProcessorCustomerError("We could not find the customer in the database")
|
||||||
|
|
||||||
active_subscriptions = []
|
active_subscriptions = []
|
||||||
|
|
||||||
cards = result.credit_cards
|
cards = result.credit_cards
|
||||||
for card in cards:
|
for card in cards:
|
||||||
for subscription in card.subscriptions:
|
for subscription in card.subscriptions:
|
||||||
@@ -360,12 +363,12 @@ def find_subscriptions(rower):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
for subscription in active_subscriptions:
|
for subscription in active_subscriptions:
|
||||||
|
|
||||||
plan = PaidPlan.objects.filter(paymentprocessor="braintree",
|
plan = PaidPlan.objects.filter(paymentprocessor="braintree",
|
||||||
external_id=subscription.plan_id)[0]
|
external_id=subscription.plan_id)[0]
|
||||||
|
|
||||||
thedict = {
|
thedict = {
|
||||||
'end_date': subscription.billing_period_end_date,
|
'end_date': subscription.billing_period_end_date,
|
||||||
'plan_id': subscription.plan_id,
|
'plan_id': subscription.plan_id,
|
||||||
@@ -444,7 +447,7 @@ def get_transactions(start_date,end_date):
|
|||||||
transaction.credit_card_details.country_of_issuance)
|
transaction.credit_card_details.country_of_issuance)
|
||||||
statuses.append(transaction.status)
|
statuses.append(transaction.status)
|
||||||
|
|
||||||
|
|
||||||
df = pd.DataFrame({
|
df = pd.DataFrame({
|
||||||
'name':names,
|
'name':names,
|
||||||
'email':emails,
|
'email':emails,
|
||||||
|
|||||||
@@ -153,7 +153,15 @@ def get_video_data(w,groups=['basic']):
|
|||||||
|
|
||||||
boatspeed = (100*df2['velo']).astype(int)/100.
|
boatspeed = (100*df2['velo']).astype(int)/100.
|
||||||
|
|
||||||
coordinates = get_latlon_time(w.id)
|
try:
|
||||||
|
coordinates = get_latlon_time(w.id)
|
||||||
|
except KeyError:
|
||||||
|
nulseries = df['time']*0
|
||||||
|
coordinates = pd.DataFrame({
|
||||||
|
'time': df['time'],
|
||||||
|
'latitude': nulseries,
|
||||||
|
'longitude': nulseries,
|
||||||
|
})
|
||||||
|
|
||||||
coordinates.set_index(pd.to_timedelta(coordinates['time'],unit='s'),inplace=True)
|
coordinates.set_index(pd.to_timedelta(coordinates['time'],unit='s'),inplace=True)
|
||||||
coordinates = coordinates.resample('1s').mean().interpolate()
|
coordinates = coordinates.resample('1s').mean().interpolate()
|
||||||
@@ -1816,6 +1824,7 @@ def getrowdata_db(id=0, doclean=False, convertnewtons=True,
|
|||||||
def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,compute=True):
|
def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,compute=True):
|
||||||
# prepmultipledata(ids)
|
# prepmultipledata(ids)
|
||||||
|
|
||||||
|
|
||||||
if ids:
|
if ids:
|
||||||
csvfilenames = ['media/strokedata_{id}.parquet.gz'.format(id=id) for id in ids]
|
csvfilenames = ['media/strokedata_{id}.parquet.gz'.format(id=id) for id in ids]
|
||||||
else:
|
else:
|
||||||
@@ -1825,6 +1834,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
|
|||||||
columns = [c for c in columns if c != 'None']
|
columns = [c for c in columns if c != 'None']
|
||||||
columns = list(set(columns))
|
columns = list(set(columns))
|
||||||
|
|
||||||
|
|
||||||
if len(ids)>1:
|
if len(ids)>1:
|
||||||
for id,f in zip(ids,csvfilenames):
|
for id,f in zip(ids,csvfilenames):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -726,7 +726,10 @@ def getsmallrowdata_db(columns,ids=[],debug=False):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
df = pd.DataFrame()
|
df = pd.DataFrame()
|
||||||
else:
|
else:
|
||||||
df = pd.read_parquet(csvfilenames[0],columns=columns,engine='pyarrow')
|
try:
|
||||||
|
df = pd.read_parquet(csvfilenames[0],columns=columns,engine='pyarrow')
|
||||||
|
except (OSError,IndexError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
return df
|
return df
|
||||||
@@ -1257,7 +1260,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
|||||||
data.fillna(0,inplace=True)
|
data.fillna(0,inplace=True)
|
||||||
for k, v in dtypes.items():
|
for k, v in dtypes.items():
|
||||||
try:
|
try:
|
||||||
data[k] = data[k].astype(v)
|
data[k] = data[k].astype(v)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -2814,7 +2814,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}):
|
|||||||
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair'
|
||||||
|
|
||||||
|
|
||||||
columns = ['time','pace','hr','fpace','ftime']
|
columns = ['time','pace','hr','fpace','ftime','spm']
|
||||||
datadf = dataprep.getsmallrowdata_db(columns,ids=[id])
|
datadf = dataprep.getsmallrowdata_db(columns,ids=[id])
|
||||||
|
|
||||||
datadf.dropna(axis=0,how='any',inplace=True)
|
datadf.dropna(axis=0,how='any',inplace=True)
|
||||||
@@ -2945,10 +2945,90 @@ def interactive_chart(id=0,promember=0,intervaldata = {}):
|
|||||||
hover.mode = 'mouse'
|
hover.mode = 'mouse'
|
||||||
hover.names = ["spm","pace"]
|
hover.names = ["spm","pace"]
|
||||||
|
|
||||||
script, div = components(plot)
|
script, div = components(layout)
|
||||||
|
|
||||||
return [script,div]
|
return [script,div]
|
||||||
|
|
||||||
|
def interactive_chart_video(videodata):
|
||||||
|
|
||||||
|
spm = videodata['spm']
|
||||||
|
time = range(len(spm))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data = zip(time,spm)
|
||||||
|
|
||||||
|
data2 = []
|
||||||
|
|
||||||
|
for t,s in data:
|
||||||
|
data2.append(
|
||||||
|
{
|
||||||
|
'x':t,
|
||||||
|
'y':s,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
markerpoint = {
|
||||||
|
'x': time[0],
|
||||||
|
'y': spm[0],
|
||||||
|
'r': 10,
|
||||||
|
}
|
||||||
|
|
||||||
|
div = """
|
||||||
|
<canvas id="myChart">
|
||||||
|
</canvas>
|
||||||
|
"""
|
||||||
|
|
||||||
|
script = """
|
||||||
|
var ctx = document.getElementById("myChart").getContext('2d');
|
||||||
|
var data = %s
|
||||||
|
|
||||||
|
var myChart = new Chart(ctx, {
|
||||||
|
type: 'scatter',
|
||||||
|
label: 'pace',
|
||||||
|
data:
|
||||||
|
{
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
type: 'bubble',
|
||||||
|
label: 'now',
|
||||||
|
data: [ %s ],
|
||||||
|
backgroundColor: '#36a2eb',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'spm',
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
var marker = {
|
||||||
|
datapoint: %s ,
|
||||||
|
setLatLng: function (LatLng) {
|
||||||
|
var lat = LatLng.lat;
|
||||||
|
var lng = LatLng.lng;
|
||||||
|
this.datapoint = {
|
||||||
|
'x': lat,
|
||||||
|
'y': lng,
|
||||||
|
'r': 10,
|
||||||
|
}
|
||||||
|
myChart.data.datasets[0].data[0] = this.datapoint;
|
||||||
|
myChart.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marker.setLatLng({
|
||||||
|
'lat': data[0]['x'],
|
||||||
|
'lng': data[0]['y']
|
||||||
|
})
|
||||||
|
|
||||||
|
""" % (data2, markerpoint, markerpoint)
|
||||||
|
|
||||||
|
return [script,div]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
||||||
ploterrorbars=False,
|
ploterrorbars=False,
|
||||||
title=None,binsize=1,colorlegend=[],
|
title=None,binsize=1,colorlegend=[],
|
||||||
@@ -3435,10 +3515,10 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
var distance1 = data['distance']
|
var distance1 = data['distance']
|
||||||
var power1 = data['power']
|
var power1 = data['power']
|
||||||
var driveenergy1 = data['driveenergy']
|
var driveenergy1 = data['driveenergy']
|
||||||
var xname = data['xname'][0]
|
var xname = data['xname']
|
||||||
var yname1 = data['yname1'][0]
|
var yname1 = data['yname1']
|
||||||
var yname2 = data['yname2'][0]
|
var yname2 = data['yname2']
|
||||||
var workoutid1 = data['workoutid'][0]
|
var workoutid1 = data['workoutid']
|
||||||
|
|
||||||
var minspm = minspm.value
|
var minspm = minspm.value
|
||||||
var maxspm = maxspm.value
|
var maxspm = maxspm.value
|
||||||
@@ -3483,10 +3563,10 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
data2['driveenergy'].push(driveenergy1[i])
|
data2['driveenergy'].push(driveenergy1[i])
|
||||||
data2['distance'].push(distance1[i])
|
data2['distance'].push(distance1[i])
|
||||||
data2['power'].push(power1[i])
|
data2['power'].push(power1[i])
|
||||||
data2['workoutid'].push(workoutid1)
|
data2['workoutid'].push(0)
|
||||||
data2['xname'].push(xname)
|
data2['xname'].push(0)
|
||||||
data2['yname1'].push(yname1)
|
data2['yname1'].push(0)
|
||||||
data2['yname2'].push(yname2)
|
data2['yname2'].push(0)
|
||||||
|
|
||||||
xm += x1[i]
|
xm += x1[i]
|
||||||
ym1 += y1[i]
|
ym1 += y1[i]
|
||||||
@@ -3510,9 +3590,9 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
x1means.location = xm
|
x1means.location = xm
|
||||||
y1means.location = ym1
|
y1means.location = ym1
|
||||||
y2means.location = ym2
|
y2means.location = ym2
|
||||||
y1label.text = yname1+': '+(ym1).toFixed(2)
|
y1label.text = yname1[0]+': '+(ym1).toFixed(2)
|
||||||
y2label.text = yname2+': '+(ym2).toFixed(2)
|
y2label.text = yname2[0]+': '+(ym2).toFixed(2)
|
||||||
xlabel.text = xname+': '+(xm).toFixed(2)
|
xlabel.text = xname[0]+': '+(xm).toFixed(2)
|
||||||
|
|
||||||
source2.change.emit();
|
source2.change.emit();
|
||||||
""")
|
""")
|
||||||
@@ -3596,16 +3676,16 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
columns = [xparam,yparam1,yparam2,
|
columns = [xparam,yparam1,yparam2,
|
||||||
'ftime','distance','fpace',
|
'ftime','distance','fpace',
|
||||||
'power','hr','spm','driveenergy',
|
'power','hr','spm','driveenergy',
|
||||||
'time','pace','workoutstate','time']
|
'time','pace','workoutstate']
|
||||||
|
|
||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
|
|
||||||
if rowdata.empty:
|
if len(rowdata)<2:
|
||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True,
|
||||||
workstrokesonly=False)
|
workstrokesonly=False)
|
||||||
workstrokesonly=False
|
workstrokesonly=False
|
||||||
if rowdata.empty:
|
if len(rowdata)<2:
|
||||||
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],
|
rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],
|
||||||
doclean=False,
|
doclean=False,
|
||||||
workstrokesonly=False)
|
workstrokesonly=False)
|
||||||
@@ -3760,6 +3840,8 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
rowdata
|
rowdata
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# second source for filtering
|
# second source for filtering
|
||||||
source2 = ColumnDataSource(
|
source2 = ColumnDataSource(
|
||||||
rowdata.copy()
|
rowdata.copy()
|
||||||
@@ -4014,12 +4096,11 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
var distance1 = data['distance']
|
var distance1 = data['distance']
|
||||||
var power1 = data['power']
|
var power1 = data['power']
|
||||||
var driveenergy1 = data['driveenergy']
|
var driveenergy1 = data['driveenergy']
|
||||||
var xname = data['xname'][0]
|
var xname = data['xname']
|
||||||
var yname1 = data['yname1'][0]
|
var yname1 = data['yname1']
|
||||||
var yname2 = data['yname2'][0]
|
var yname2 = data['yname2']
|
||||||
var workoutid1 = data['workoutid'][0]
|
var workoutid1 = data['workoutid']
|
||||||
var workoutstate1 = data['workoutstate'][0]
|
var workoutstate1 = data['workoutstate']
|
||||||
|
|
||||||
|
|
||||||
var annotation = annotation.value
|
var annotation = annotation.value
|
||||||
var minspm = minspm.value
|
var minspm = minspm.value
|
||||||
@@ -4077,11 +4158,11 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
data2['hr'].push(hr1[i])
|
data2['hr'].push(hr1[i])
|
||||||
data2['distance'].push(distance1[i])
|
data2['distance'].push(distance1[i])
|
||||||
data2['power'].push(power1[i])
|
data2['power'].push(power1[i])
|
||||||
data2['workoutid'].push(workoutid1)
|
data2['workoutid'].push(0)
|
||||||
data2['workoutstate'].push(workoutstate1)
|
data2['workoutstate'].push(0)
|
||||||
data2['xname'].push(xname)
|
data2['xname'].push(0)
|
||||||
data2['yname1'].push(yname1)
|
data2['yname1'].push(0)
|
||||||
data2['yname2'].push(yname2)
|
data2['yname2'].push(0)
|
||||||
|
|
||||||
|
|
||||||
xm += x1[i]
|
xm += x1[i]
|
||||||
@@ -4107,9 +4188,9 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
x1means.location = xm
|
x1means.location = xm
|
||||||
y1means.location = ym1
|
y1means.location = ym1
|
||||||
y2means.location = ym2
|
y2means.location = ym2
|
||||||
y1label.text = yname1+': '+ym1.toFixed(2)
|
y1label.text = yname1[0]+': '+ym1.toFixed(2)
|
||||||
y2label.text = yname2+': '+ym2.toFixed(2)
|
y2label.text = yname2[0]+': '+ym2.toFixed(2)
|
||||||
xlabel.text = xname+': '+xm.toFixed(2)
|
xlabel.text = xname[0]+': '+xm.toFixed(2)
|
||||||
annolabel.text = annotation
|
annolabel.text = annotation
|
||||||
|
|
||||||
source2.change.emit();
|
source2.change.emit();
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
{% block meta %}
|
{% block meta %}
|
||||||
{% leaflet_js %}
|
{% leaflet_js %}
|
||||||
{% leaflet_css %}
|
{% leaflet_css %}
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.js"></script>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
@@ -71,12 +73,13 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<div style="height:100%" id="theplot" class="flexplot mapdiv">
|
<div id="theplot" class="flexplot mapdiv">
|
||||||
{{ mapdiv | safe}}
|
{{ mapdiv | safe}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="slidecontainer">
|
<div class="slidecontainer">
|
||||||
<input type="range" min="0" max="{{ maxtime }}" value="{{ analysis.delay }}" class="slider" id="myRange">
|
<input type="range" min="0" max="{{ maxtime }}" value="{{ analysis.delay }}"
|
||||||
|
id="myRange">
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
@@ -85,6 +88,7 @@
|
|||||||
// 1. Code for the map
|
// 1. Code for the map
|
||||||
{{ mapscript | safe }}
|
{{ mapscript | safe }}
|
||||||
|
|
||||||
|
|
||||||
// 2. This code loads the IFrame Player API code asynchronously.
|
// 2. This code loads the IFrame Player API code asynchronously.
|
||||||
var tag = document.createElement('script');
|
var tag = document.createElement('script');
|
||||||
|
|
||||||
@@ -154,6 +158,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
// gauge.set(catch_now);
|
// gauge.set(catch_now);
|
||||||
var newLatLng = new L.LatLng(lat, lon);
|
var newLatLng = new L.LatLng(lat, lon);
|
||||||
|
console.log(newLatLng);
|
||||||
marker.setLatLng(newLatLng);
|
marker.setLatLng(newLatLng);
|
||||||
}
|
}
|
||||||
if(videotime !== oldTime) {
|
if(videotime !== oldTime) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<h1>Flexible Chart</h1>
|
<h1>Flexible Chart</h1>
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
<div id="theplot" class="flexplot">
|
<div id="theplot" class="flexplot">
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
{% if favoritenr > 0 %}
|
{% if favoritenr > 0 %}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ defaultoptions = {
|
|||||||
|
|
||||||
|
|
||||||
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def analysis_new(request,userid=0,function='boxplot',teamid=0):
|
def analysis_new(request,userid=0,function='boxplot',teamid=0):
|
||||||
r = getrequestrower(request, userid=userid)
|
r = getrequestrower(request, userid=userid)
|
||||||
@@ -667,7 +667,7 @@ def boxplotdata(workouts,options):
|
|||||||
return(script,div)
|
return(script,div)
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def analysis_view_data(request,userid=0):
|
def analysis_view_data(request,userid=0):
|
||||||
if not request.is_ajax():
|
if not request.is_ajax():
|
||||||
@@ -725,7 +725,7 @@ def analysis_view_data(request,userid=0):
|
|||||||
|
|
||||||
# Histogram for a date/time range
|
# Histogram for a date/time range
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def histo(request,theuser=0,
|
def histo(request,theuser=0,
|
||||||
startdate=timezone.now()-datetime.timedelta(days=365),
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||||
@@ -2148,7 +2148,7 @@ def rankings_view2(request,theuser=0,
|
|||||||
|
|
||||||
# Show ranking distances including predicted paces
|
# Show ranking distances including predicted paces
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def otwrankings_view(request,theuser=0,
|
def otwrankings_view(request,theuser=0,
|
||||||
startdate=timezone.now()-datetime.timedelta(days=365),
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||||
@@ -2553,7 +2553,7 @@ def otwcp_toadmin_view(request,theuser=0,
|
|||||||
|
|
||||||
# Show ranking distances including predicted paces
|
# Show ranking distances including predicted paces
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def oterankings_view(request,theuser=0,
|
def oterankings_view(request,theuser=0,
|
||||||
startdate=timezone.now()-datetime.timedelta(days=365),
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||||
@@ -2904,7 +2904,7 @@ def oterankings_view(request,theuser=0,
|
|||||||
|
|
||||||
# Multi Flex Chart with Grouping
|
# Multi Flex Chart with Grouping
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def user_multiflex_select(request,
|
def user_multiflex_select(request,
|
||||||
startdatestring="",
|
startdatestring="",
|
||||||
@@ -3110,7 +3110,7 @@ def user_multiflex_select(request,
|
|||||||
})
|
})
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def multiflex_data(request,userid=0,
|
def multiflex_data(request,userid=0,
|
||||||
options={
|
options={
|
||||||
@@ -3363,7 +3363,7 @@ def multiflex_data(request,userid=0,
|
|||||||
|
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def multiflex_view(request,userid=0,
|
def multiflex_view(request,userid=0,
|
||||||
options={
|
options={
|
||||||
@@ -3530,7 +3530,7 @@ def multiflex_view(request,userid=0,
|
|||||||
|
|
||||||
# Box plots
|
# Box plots
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def user_boxplot_select(request,
|
def user_boxplot_select(request,
|
||||||
startdatestring="",
|
startdatestring="",
|
||||||
@@ -3738,7 +3738,7 @@ def user_boxplot_select(request,
|
|||||||
})
|
})
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def boxplot_view_data(request,userid=0,
|
def boxplot_view_data(request,userid=0,
|
||||||
options={
|
options={
|
||||||
@@ -3855,7 +3855,7 @@ def boxplot_view_data(request,userid=0,
|
|||||||
})
|
})
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def boxplot_view(request,userid=0,
|
def boxplot_view(request,userid=0,
|
||||||
options={
|
options={
|
||||||
@@ -3974,7 +3974,7 @@ def boxplot_view(request,userid=0,
|
|||||||
|
|
||||||
|
|
||||||
# Cumulative stats page
|
# Cumulative stats page
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None)
|
||||||
def cumstats(request,theuser=0,
|
def cumstats(request,theuser=0,
|
||||||
startdate=timezone.now()-datetime.timedelta(days=30),
|
startdate=timezone.now()-datetime.timedelta(days=30),
|
||||||
enddate=timezone.now(),
|
enddate=timezone.now(),
|
||||||
@@ -4323,7 +4323,7 @@ def agegrouprecordview(request,sex='male',weightcategory='hwt',
|
|||||||
|
|
||||||
# alert overview view
|
# alert overview view
|
||||||
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def alerts_view(request,userid=0):
|
def alerts_view(request,userid=0):
|
||||||
r = getrequestrower(request,userid=userid)
|
r = getrequestrower(request,userid=userid)
|
||||||
@@ -4357,7 +4357,7 @@ def alerts_view(request,userid=0):
|
|||||||
|
|
||||||
# alert create view
|
# alert create view
|
||||||
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def alert_create_view(request,userid=0):
|
def alert_create_view(request,userid=0):
|
||||||
r = getrequestrower(request,userid=userid)
|
r = getrequestrower(request,userid=userid)
|
||||||
@@ -4437,7 +4437,7 @@ def alert_create_view(request,userid=0):
|
|||||||
|
|
||||||
# alert report view
|
# alert report view
|
||||||
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def alert_report_view(request,id=0,userid=0,nperiod=0):
|
def alert_report_view(request,id=0,userid=0,nperiod=0):
|
||||||
r = getrequestrower(request,userid=userid)
|
r = getrequestrower(request,userid=userid)
|
||||||
@@ -4494,7 +4494,7 @@ def alert_report_view(request,id=0,userid=0,nperiod=0):
|
|||||||
|
|
||||||
# alert edit view
|
# alert edit view
|
||||||
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
@user_passes_test(ispromember, login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def alert_edit_view(request,id=0,userid=0):
|
def alert_edit_view(request,id=0,userid=0):
|
||||||
r = getrequestrower(request,userid=userid)
|
r = getrequestrower(request,userid=userid)
|
||||||
|
|||||||
@@ -196,9 +196,16 @@ def workout_video_create_view(request,id=0):
|
|||||||
|
|
||||||
# get data
|
# get data
|
||||||
data, metrics, maxtime = dataprep.get_video_data(w,groups=metricsgroups)
|
data, metrics, maxtime = dataprep.get_video_data(w,groups=metricsgroups)
|
||||||
|
hascoordinates = pd.Series(data['latitude']).std() > 0
|
||||||
|
|
||||||
# create map
|
# create map
|
||||||
mapscript, mapdiv = leaflet_chart_video(data['latitude'],data['longitude'],
|
if hascoordinates:
|
||||||
|
mapscript, mapdiv = leaflet_chart_video(data['latitude'],data['longitude'],
|
||||||
w.name)
|
w.name)
|
||||||
|
else:
|
||||||
|
mapscript, mapdiv = interactive_chart_video(data)
|
||||||
|
data['longitude'] = data['spm']
|
||||||
|
data['latitude'] = list(range(len(data['spm'])))
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -218,8 +225,12 @@ def workout_video_create_view(request,id=0):
|
|||||||
|
|
||||||
analysis = {'delay':delay}
|
analysis = {'delay':delay}
|
||||||
|
|
||||||
|
template = 'embedded_video.html'
|
||||||
|
|
||||||
|
print(data['latitude'],'aap')
|
||||||
|
|
||||||
return render(request,
|
return render(request,
|
||||||
'embedded_video.html',
|
template,
|
||||||
{
|
{
|
||||||
'workout':w,
|
'workout':w,
|
||||||
'rower':request.user.rower,
|
'rower':request.user.rower,
|
||||||
@@ -238,7 +249,7 @@ def workout_video_create_view(request,id=0):
|
|||||||
|
|
||||||
# Show the EMpower Oarlock generated Stroke Profile
|
# Show the EMpower Oarlock generated Stroke Profile
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans/",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans/",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_forcecurve_view(request,id=0,workstrokesonly=False):
|
def workout_forcecurve_view(request,id=0,workstrokesonly=False):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
@@ -566,8 +577,9 @@ def fitness_metric_view(request,mode='rower',days=42):
|
|||||||
return HttpResponse("job queued")
|
return HttpResponse("job queued")
|
||||||
|
|
||||||
|
|
||||||
|
@login_required()
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_update_cp_view(request,id=0):
|
def workout_update_cp_view(request,id=0):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
@@ -630,7 +642,7 @@ def workout_recalcsummary_view(request,id=0):
|
|||||||
|
|
||||||
# Joining workout
|
# Joining workout
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workouts_join_view(request):
|
def workouts_join_view(request):
|
||||||
promember=0
|
promember=0
|
||||||
@@ -875,7 +887,7 @@ def video_selectworkout(request,userid=0,teamid=0):
|
|||||||
|
|
||||||
|
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workouts_join_select(request,
|
def workouts_join_select(request,
|
||||||
startdatestring="",
|
startdatestring="",
|
||||||
@@ -1033,7 +1045,7 @@ def workouts_join_select(request,
|
|||||||
|
|
||||||
# Team comparison
|
# Team comparison
|
||||||
@user_passes_test(ispromember,login_url='/rowers/paidplans/',
|
@user_passes_test(ispromember,login_url='/rowers/paidplans/',
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def team_comparison_select(request,
|
def team_comparison_select(request,
|
||||||
startdatestring="",
|
startdatestring="",
|
||||||
@@ -1816,7 +1828,7 @@ def workouts_view(request,message='',successmessage='',
|
|||||||
|
|
||||||
# List of workouts to compare a selected workout to
|
# List of workouts to compare a selected workout to
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_fusion_list(request,id=0,message='',successmessage='',
|
def workout_fusion_list(request,id=0,message='',successmessage='',
|
||||||
startdatestring="",enddatestring="",
|
startdatestring="",enddatestring="",
|
||||||
@@ -2022,7 +2034,7 @@ def workout_view(request,id=0):
|
|||||||
|
|
||||||
# Resets stroke data to raw data (pace)
|
# Resets stroke data to raw data (pace)
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_undo_smoothenpace_view(
|
def workout_undo_smoothenpace_view(
|
||||||
request,id=0,message="",successmessage=""
|
request,id=0,message="",successmessage=""
|
||||||
@@ -2061,7 +2073,7 @@ def workout_undo_smoothenpace_view(
|
|||||||
|
|
||||||
# Data smoothing of pace data
|
# Data smoothing of pace data
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
@@ -2114,7 +2126,7 @@ def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
|||||||
|
|
||||||
# Process CrewNerd Summary CSV and update summary
|
# Process CrewNerd Summary CSV and update summary
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
@@ -2191,7 +2203,7 @@ def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
|||||||
|
|
||||||
# Get weather for given location and date/time
|
# Get weather for given location and date/time
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_downloadwind_view(request,id=0,
|
def workout_downloadwind_view(request,id=0,
|
||||||
airportcode=None,
|
airportcode=None,
|
||||||
@@ -2265,7 +2277,7 @@ def workout_downloadwind_view(request,id=0,
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
# Get weather for given location and date/time
|
# Get weather for given location and date/time
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None)
|
||||||
def workout_downloadmetar_view(request,id=0,
|
def workout_downloadmetar_view(request,id=0,
|
||||||
airportcode=None,
|
airportcode=None,
|
||||||
message="",successmessage=""):
|
message="",successmessage=""):
|
||||||
@@ -2340,7 +2352,7 @@ def workout_downloadmetar_view(request,id=0,
|
|||||||
|
|
||||||
|
|
||||||
# Show form to update wind data
|
# Show form to update wind data
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None)
|
||||||
def workout_wind_view(request,id=0,message="",successmessage=""):
|
def workout_wind_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
r = getrower(request.user)
|
r = getrower(request.user)
|
||||||
@@ -2476,7 +2488,7 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
|
|||||||
|
|
||||||
|
|
||||||
# Show form to update River stream data (for river dwellers)
|
# Show form to update River stream data (for river dwellers)
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None)
|
||||||
def workout_stream_view(request,id=0,message="",successmessage=""):
|
def workout_stream_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
r = getrower(request.user)
|
r = getrower(request.user)
|
||||||
@@ -5098,7 +5110,7 @@ def workout_summary_restore_view(request,id,message="",successmessage=""):
|
|||||||
|
|
||||||
# Split a workout
|
# Split a workout
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",
|
||||||
message="This functionality requires a Pro plan or higher",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
def workout_split_view(request,id=0):
|
def workout_split_view(request,id=0):
|
||||||
row = get_workout_permitted(request.user,id)
|
row = get_workout_permitted(request.user,id)
|
||||||
@@ -5194,7 +5206,7 @@ def workout_split_view(request,id=0):
|
|||||||
|
|
||||||
|
|
||||||
# Fuse two workouts
|
# Fuse two workouts
|
||||||
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None)
|
||||||
def workout_fusion_view(request,id1=0,id2=1):
|
def workout_fusion_view(request,id1=0,id2=1):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user