From 657e9e9cd0ee6d64291aeab7be3ecda397cfbb2c Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 3 Nov 2017 13:39:53 +0100 Subject: [PATCH] has "Make Ranking" on left panel workflow page --- rowers/dataprep.py | 1 + rowers/templates/panel_ranking.html | 6 ++++++ rowers/templates/summary_edit.html | 4 ++++ rowers/utils.py | 1 + rowers/views.py | 5 ++++- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 rowers/templates/panel_ranking.html diff --git a/rowers/dataprep.py b/rowers/dataprep.py index b7efd793..9388c84f 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -527,6 +527,7 @@ def fetchcp(rower,theworkouts,table='cpdata'): theids = [int(w.id) for w in theworkouts] columns = ['power','workoutid','time'] df = getsmallrowdata_db(columns,ids=theids) + df.dropna(inplace=True,axis=0) if df.empty: avgpower2 = {} for id in theids: diff --git a/rowers/templates/panel_ranking.html b/rowers/templates/panel_ranking.html new file mode 100644 index 00000000..584ea695 --- /dev/null +++ b/rowers/templates/panel_ranking.html @@ -0,0 +1,6 @@ +
+

+ + Make Ranking Piece +

+
diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index 2d49567a..93e1d89a 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -79,6 +79,10 @@ Four intervals of 6, 5, 3 and 3 minutes length, 3 minutes rest +8x500m/3:30min +8 times 500m with 3 minutes 30 seconds rest + + 4x(500m+500m)/5min4 times 1km, but each km is reported as two 500m intervals without rest diff --git a/rowers/utils.py b/rowers/utils.py index 976418db..84c70aba 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -45,6 +45,7 @@ workflowleftpanel = ( ('panel_editstream.html','Edit Stream Data'), ('panel_otwpower.html','Run OTW Power Calculations'), ('panel_mapview.html','Map'), + ('panel_ranking.html','Ranking View'), ) defaultleft = [ diff --git a/rowers/views.py b/rowers/views.py index 395f306d..9b4820dd 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -3252,7 +3252,10 @@ def workout_update_cp_view(request,id=0): dataprep.runcpupdate(r) - url = reverse(otwrankings_view) + if row.workouttype in ('water','coastal'): + url = reverse(otwrankings_view) + else: + url = reverse(oterankings_view) return HttpResponseRedirect(url)