diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py
index 6bebbd2a..8d508a48 100644
--- a/rowers/interactiveplots.py
+++ b/rowers/interactiveplots.py
@@ -3312,7 +3312,6 @@ def interactive_chart(id=0,promember=0,intervaldata = {}):
plot.legend.location = "bottom_right"
-
# add shaded bar chart areas
if intervaldata != {}:
intervaldf = pd.DataFrame(intervaldata)
diff --git a/rowers/templates/virtualevent.html b/rowers/templates/virtualevent.html
index 9e4187c2..abdc4a03 100644
--- a/rowers/templates/virtualevent.html
+++ b/rowers/templates/virtualevent.html
@@ -282,7 +282,7 @@
| {{ forloop.counter }} |
-
+
{{ result.username }} |
{{ result.teamname }} |
{{ result.age }} |
@@ -302,7 +302,7 @@
{{ result.duration |durationprint:"%H:%M:%S.%f" }} |
{{ result.distance }} m |
-
+
Details |
{% if race.manager == request.user and not race|is_final %}
diff --git a/rowers/templates/workout_view.html b/rowers/templates/workout_view.html
index 8cc738f1..942b9534 100644
--- a/rowers/templates/workout_view.html
+++ b/rowers/templates/workout_view.html
@@ -111,7 +111,7 @@
- {{ workout.summary }}
+ {{ summary }}
diff --git a/rowers/urls.py b/rowers/urls.py
index 097ad88c..c03c809b 100644
--- a/rowers/urls.py
+++ b/rowers/urls.py
@@ -352,6 +352,7 @@ urlpatterns = [
re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/restore/$',views.workout_summary_restore_view,name='workout_summary_restore_view'),
re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/split/$',views.workout_split_view,name='workout_split_view'),
# re_path(r'^workout/(?P\d+)/interactiveplot/$',views.workout_biginteractive_view),
+ re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/view/entry/(?P\d+)/$',views.workout_view,name='workout_view'),
re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/view/$',views.workout_view,name='workout_view'),
re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/video/$',views.workout_video_create_view,
name='workout_video_create_view'),
diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py
index 6e851339..aec07a9e 100644
--- a/rowers/views/workoutviews.py
+++ b/rowers/views/workoutviews.py
@@ -2156,7 +2156,7 @@ def workout_fusion_list(request,id=0,
# Basic view of workout
@permission_required('workout.view_workout',fn=get_workout_by_opaqueid,raise_exception=True)
-def workout_view(request,id=0):
+def workout_view(request,id=0,raceresult=0):
request.session['referer'] = absolute(request)['PATH']
if not request.user.is_anonymous:
@@ -2164,7 +2164,10 @@ def workout_view(request,id=0):
else:
rower = None
+ # get row
row = get_workout_by_opaqueid(request,id)
+ f1 = row.csvfilename
+ rowdata = rdata(f1)
comments = WorkoutComment.objects.filter(workout=row)
@@ -2181,16 +2184,33 @@ def workout_view(request,id=0):
except:
pass
+ # get raceresult
+ intervaldata = {}
+ if raceresult != 0:
+ try:
+ result = VirtualRaceResult.objects.get(id=raceresult)
+ startsecond = result.startsecond
+ endsecond = result.endsecond
+ duration = row.duration
+ durationsecs = duration.hour*3600+duration.minute*60+duration.second
+ itime = [startsecond,endsecond-startsecond]
+ itype = [3,4]
+ intervaldata['itime'] = itime
+ intervaldata['itype'] = itype
+ rowdata.updateinterval_metric(' AverageBoatSpeed (m/s)',0.1,mode='larger',
+ debug=False,smoothwindow=15.,
+ activewindow = [startsecond,endsecond])
+ summary = rowdata.allstats()
+ except VirtualRaceResult.DoesNotExist:
+ summary = row.summary
# create interactive plot
- res = interactive_chart(encoder.decode_hex(id))
+ res = interactive_chart(encoder.decode_hex(id),intervaldata=intervaldata)
script = res[0]
div = res[1]
# create map
- f1 = row.csvfilename
- rowdata = rdata(f1)
hascoordinates = 1
if rowdata != 0:
try:
@@ -2239,6 +2259,7 @@ def workout_view(request,id=0):
'graphs':g,
'last_name':u.last_name,
'records':records,
+ 'summary':summary,
'recordsindoor':recordsindoor,
'first_name':u.first_name,
'interactiveplot':script,
|