From a562fc3f640a7102d0b5641bd0a38cbd55e7820e Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Want to add race results but you don't have stroke data? - Click here.
+ Click here.Scroll down for the chart and pace predictions for ranking pieces.
diff --git a/rowers/urls.py b/rowers/urls.py index 0807ffef..b17568ad 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -154,7 +154,7 @@ urlpatterns = [ url(r'^list-workouts/$',views.workouts_view), url(r'^list-courses/$',views.courses_view), url(r'^courses/upload$',views.course_upload_view), - url(r'^addmanual/$',views.addmanual_view), + url(r'^workout/addmanual/$',views.addmanual_view), url(r'^team-compare-select/workout/(?P
diff --git a/rowers/views.py b/rowers/views.py
index 7efff095..47b71963 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -49,6 +49,7 @@ from rowers.forms import (
VirtualRaceSelectForm,WorkoutRaceSelectForm,CourseSelectForm,
RaceResultFilterForm,PowerIntervalUpdateForm,FlexAxesForm,
FlexOptionsForm,DataFrameColumnsForm,OteWorkoutTypeForm,
+ MetricsForm,
)
from django.core.urlresolvers import reverse, reverse_lazy
@@ -3294,12 +3295,26 @@ def histo(request,theuser=0,
def addmanual_view(request):
r = Rower.objects.get(user=request.user)
+ breadcrumbs = [
+ {
+ 'url':'/rowers/list-workouts',
+ 'name':'Workouts'
+ },
+ {
+ 'url':reverse(addmanual_view),
+ 'name': 'Add Manual Entry'
+ },
+ ]
+
if request.method == 'POST':
# Form was submitted
form = WorkoutForm(request.POST)
- if form.is_valid():
+ metricsform = MetricsForm(request.POST)
+ if form.is_valid() and metricsform.is_valid():
# Get values from form
name = form.cleaned_data['name']
+ if name == '':
+ name = 'Manual Entry'
date = form.cleaned_data['date']
starttime = form.cleaned_data['starttime']
workouttype = form.cleaned_data['workouttype']
@@ -3309,6 +3324,9 @@ def addmanual_view(request):
notes = form.cleaned_data['notes']
thetimezone = form.cleaned_data['timezone']
private = form.cleaned_data['private']
+ avghr = metricsform.cleaned_data['avghr']
+ avgpwr = metricsform.cleaned_data['avgpwr']
+ avgspm = metricsform.cleaned_data['avgspm']
try:
boattype = request.POST['boattype']
except KeyError:
@@ -3336,12 +3354,17 @@ def addmanual_view(request):
)
+
id,message = dataprep.create_row_df(r,
distance,
-# weightcategory,
duration,startdatetime,
-# title = name,
-# notes=notes,
+ weightcategory=weightcategory,
+ avghr=avghr,
+ rankingpiece=rankingpiece,
+ avgpwr=avgpwr,
+ avgspm=avgspm,
+ title = name,
+ notes=notes,
workouttype=workouttype)
@@ -3351,7 +3374,7 @@ def addmanual_view(request):
if id:
w = Workout.objects.get(id=id)
- w.rankingpiece = rankingpiece or is_ranking_piece(w)
+ w.rankingpiece = rankingpiece
w.privacy = privacy
w.weightcategory = weightcategory
w.notes = notes
@@ -3360,7 +3383,13 @@ def addmanual_view(request):
w.boattype = boattype
w.save()
messages.info(request,'New workout created')
-
+ else:
+ return render(request,'manualadd.html',
+ {'form':form,
+ 'metricsform':metricsform,
+ 'breadcrumbs':breadcrumbs,
+ 'active':'nav-workouts',
+ })
initial = {
'workouttype':'rower',
@@ -3372,9 +3401,12 @@ def addmanual_view(request):
}
form = WorkoutForm(initial=initial)
+ metricsform = MetricsForm()
return render(request,'manualadd.html',
{'form':form,
+ 'metricsform':metricsform,
+ 'breadcrumbs':breadcrumbs,
'active':'nav-workouts',
})
From 4955ee8692a3ac857cb295b7df18cca17bf03f30 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
- Click on session name to view, edit to change the session and on the
- traffic light symbol to add workouts to the session
-
+
+ Click on session name to view, edit to change the session and on the
+ traffic light symbol to add workouts to the session
+
+
+ Print View
+
+
-
- Print View
-
- Planned Sessions for {{ rower.user.first_name }} {{ rower.user.last_name }}
-{% if plannedsessions %}
-
-
-
-{% else %}
-You have no planned workouts for this period. Planned workouts are created
-by your coach if you are part of a team. You can create your own
-planned workouts by purchasing the "Coach" or "Self-Coach" plans.
-{% endif %}
-
-
-
-
- {% for ps in plannedsessions %}
- Status
- On or After
- On or Before
- Name
- Type
- Mode
- Edit
- Planned
- Actual
-
- Completion Date
-
-
-
- {% endfor %}
-
-
- {% if completeness|lookup:ps.id == 'not done' %}
- {% if ps.sessiontype != 'race' %}
-
-
- {% else %}
-
- {% endif %}
- {% elif completeness|lookup:ps.id == 'completed' %}
- {% if ps.sessiontype != 'race' %}
-
- {% else %}
-
- {% endif %}
- {% elif completeness|lookup:ps.id == 'partial' %}
- {% if ps.sessiontype != 'race' %}
-
- {% else %}
-
- {% endif %}
- {% else %}
- {% if ps.sessiontype != 'race' %}
-
- {% else %}
-
- {% endif %}
- {% endif %}
-
- {{ ps.startdate|date:"Y-m-d" }}
- {{ ps.enddate|date:"Y-m-d" }}
-
- {% if ps.sessiontype != 'race' %}
- {% if ps.name != '' %}
- {{ ps.name }}
- {% else %}
- Unnamed Session
- {% endif %}
- {% else %}
- {% if ps.name != '' %}
- {{ ps.name }}
- {% else %}
- Unnamed Race
- {% endif %}
- {% endif %}
-
- {{ ps.get_sessiontype_display }}
- {{ ps.get_sessionmode_display }}
-
- {% if ps.manager == request.user %}
- Edit
- {% else %}
-
- {% endif %}
-
- {{ ps.sessionvalue }}
- {{ actualvalue|lookup:ps.id }}
- {{ ps.sessionunit }}
- {% if completeness|lookup:ps.id == 'partial' %}
- {{ completiondate|lookup:ps.id|date:"Y-m-d" }}
- {% else %}
- {{ completiondate|lookup:ps.id|date:"Y-m-d" }}
+
+
+
+
+ {% else %}
+ You have no planned workouts for this period. Planned workouts are created
+ by your coach if you are part of a team. You can create your own
+ planned workouts by purchasing the "Coach" or "Self-Coach" plans.
+ {% endif %}
+
+
+
+
+ {% for ps in plannedsessions %}
+ Status
+ On or After
+ On or Before
+ Name
+ Type
+ Mode
+ Edit
+ Planned
+ Actual
+
+ Completion Date
+
+
+
+ {% endfor %}
+
+
+ {% if completeness|lookup:ps.id == 'not done' %}
+ {% if ps.sessiontype != 'race' %}
+
+
+ {% else %}
+
+ {% endif %}
+ {% elif completeness|lookup:ps.id == 'completed' %}
+ {% if ps.sessiontype != 'race' %}
+
+ {% else %}
+
+ {% endif %}
+ {% elif completeness|lookup:ps.id == 'partial' %}
+ {% if ps.sessiontype != 'race' %}
+
+ {% else %}
+
+ {% endif %}
+ {% else %}
+ {% if ps.sessiontype != 'race' %}
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+
+ {{ ps.startdate|date:"Y-m-d" }}
+ {{ ps.enddate|date:"Y-m-d" }}
+
+ {% if ps.sessiontype != 'race' %}
+ {% if ps.name != '' %}
+ {{ ps.name }}
+ {% else %}
+ Unnamed Session
+ {% endif %}
+ {% else %}
+ {% if ps.name != '' %}
+ {{ ps.name }}
+ {% else %}
+ Unnamed Race
+ {% endif %}
+ {% endif %}
+
+ {{ ps.get_sessiontype_display }}
+ {{ ps.get_sessionmode_display }}
+
+ {% if ps.manager == request.user %}
+ Edit
+ {% else %}
+
+ {% endif %}
+
+ {{ ps.sessionvalue }}
+ {{ actualvalue|lookup:ps.id }}
+ {{ ps.sessionunit }}
+ {% if completeness|lookup:ps.id == 'partial' %}
+ {{ completiondate|lookup:ps.id|date:"Y-m-d" }}
+ {% else %}
+ {{ completiondate|lookup:ps.id|date:"Y-m-d" }}
+ {% endif %}
+ Workouts that are not linked to any session
+
+
+
+
+
{% endif %}
-
+
+
+
+ {% for workout in unmatchedworkouts %}
+ Date
+ Time
+ Name
+ Type
+ Distance
+ Duration
+ Avg HR
+ Max HR
+
+
+ {% endfor %}
+
+ {{ workout.date|date:"Y-m-d" }}
+ {{ workout.starttime|date:"H:i" }}
+ {% if workout.user.user == user or user == team.manager %}
+ {% if workout.name != '' %}
+
+
+ {{ workout.name }}
+
+
+ {% else %}
+
+ No Name
+
+ {% endif %}
+ {% else %}
+ {% if workout.name != '' %}
+ {{ workout.name }}
+ {% else %}
+ No Name
+ {% endif %}
+ {% endif %}
+ {{ workout.workouttype }}
+ {{ workout.distance }}m
+ {{ workout.duration |durationprint:"%H:%M:%S.%f" }}
+ {{ workout.averagehr }}
+ {{ workout.maxhr }}
+ Workouts that are not linked to any session
-
-
-
-
-
- {% endif %}
-
-
-
-
- {% for workout in unmatchedworkouts %}
- Date
- Time
- Name
- Type
- Distance
- Duration
- Avg HR
- Max HR
-
-
- {% endfor %}
-
- {{ workout.date|date:"Y-m-d" }}
- {{ workout.starttime|date:"H:i" }}
- {% if workout.user.user == user or user == team.manager %}
- {% if workout.name != '' %}
-
-
- {{ workout.name }}
-
-
- {% else %}
-
- No Name
-
- {% endif %}
- {% else %}
- {% if workout.name != '' %}
- {{ workout.name }}
- {% else %}
- No Name
- {% endif %}
- {% endif %}
- {{ workout.workouttype }}
- {{ workout.distance }}m
- {{ workout.duration |durationprint:"%H:%M:%S.%f" }}
- {{ workout.averagehr }}
- {{ workout.maxhr }}
-
+
+ +On this page, you can create and edit sessions for an entire time diff --git a/rowers/templates/plannedsessioncreate.html b/rowers/templates/plannedsessioncreate.html index a47cbfe2..1e7b0900 100644 --- a/rowers/templates/plannedsessioncreate.html +++ b/rowers/templates/plannedsessioncreate.html @@ -8,8 +8,34 @@
{{ timeperiod }}
++
+@@ -59,24 +85,6 @@
+
+ + ++