From d92e1968e8ada3730d2a801ed5a89306eff70e0b Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Sat, 14 Dec 2019 15:31:48 +0100
Subject: [PATCH 1/8] adding json rigging files
---
static/rigging/1x.json | 1 +
static/rigging/2-.json | 1 +
static/rigging/2x.json | 1 +
static/rigging/4-.json | 1 +
static/rigging/4x.json | 1 +
static/rigging/8+.json | 1 +
6 files changed, 6 insertions(+)
create mode 100644 static/rigging/1x.json
create mode 100644 static/rigging/2-.json
create mode 100644 static/rigging/2x.json
create mode 100644 static/rigging/4-.json
create mode 100644 static/rigging/4x.json
create mode 100644 static/rigging/8+.json
diff --git a/static/rigging/1x.json b/static/rigging/1x.json
new file mode 100644
index 00000000..641e5c61
--- /dev/null
+++ b/static/rigging/1x.json
@@ -0,0 +1 @@
+{"Lin":0.9,"Mb":14,"BladeLength":0.46,"Lscull":2.425,"Nrowers":1,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":0.98}
\ No newline at end of file
diff --git a/static/rigging/2-.json b/static/rigging/2-.json
new file mode 100644
index 00000000..33cfd7fa
--- /dev/null
+++ b/static/rigging/2-.json
@@ -0,0 +1 @@
+{"Lin":1.14,"Mb":27,"BladeLength":0.46,"Lscull":2.975,"Nrowers":2,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1.05}
\ No newline at end of file
diff --git a/static/rigging/2x.json b/static/rigging/2x.json
new file mode 100644
index 00000000..83211ac8
--- /dev/null
+++ b/static/rigging/2x.json
@@ -0,0 +1 @@
+{"Lin":0.9,"Mb":27,"BladeLength":0.46,"Lscull":2.425,"Nrowers":2,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":1.05}
\ No newline at end of file
diff --git a/static/rigging/4-.json b/static/rigging/4-.json
new file mode 100644
index 00000000..ad6fbc92
--- /dev/null
+++ b/static/rigging/4-.json
@@ -0,0 +1 @@
+{"Lin":1.14,"Mb":50,"BladeLength":0.545,"Lscull":2.9325,"Nrowers":4,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1}
\ No newline at end of file
diff --git a/static/rigging/4x.json b/static/rigging/4x.json
new file mode 100644
index 00000000..77355836
--- /dev/null
+++ b/static/rigging/4x.json
@@ -0,0 +1 @@
+{"Lin":0.9,"Mb":52,"BladeLength":0.46,"Lscull":2.425,"Nrowers":4,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":1.11}
\ No newline at end of file
diff --git a/static/rigging/8+.json b/static/rigging/8+.json
new file mode 100644
index 00000000..45eafb0f
--- /dev/null
+++ b/static/rigging/8+.json
@@ -0,0 +1 @@
+{"Lin":1.14,"Mb":151,"BladeLength":0.545,"Lscull":2.9325,"Nrowers":8,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1}
\ No newline at end of file
From 8e8211a8a6bb5251b1ab6b09c0eb549a852ec7cc Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Sun, 15 Dec 2019 10:50:30 +0100
Subject: [PATCH 2/8] Adding a notes field to the training plan
---
rowers/models.py | 6 ++++--
rowers/templates/trainingplan.html | 11 ++++++++---
rowers/views/planviews.py | 4 +++-
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/rowers/models.py b/rowers/models.py
index 20a4b588..dcd7df70 100644
--- a/rowers/models.py
+++ b/rowers/models.py
@@ -1398,6 +1398,7 @@ class TrainingPlan(models.Model):
status = models.BooleanField(default=True,verbose_name='Active')
target = models.ForeignKey(TrainingTarget,blank=True,null=True,on_delete=models.SET_NULL)
startdate = models.DateField(default=current_day)
+ notes = models.CharField(blank=True,null=True,max_length=200,verbose_name='Plan Notes')
enddate = models.DateField(
default=half_year_from_now)
@@ -1476,11 +1477,12 @@ class TrainingPlan(models.Model):
class TrainingPlanForm(ModelForm):
class Meta:
model = TrainingPlan
- fields = ['name','target','startdate','enddate','status','rowers']
+ fields = ['name','target','startdate','enddate','status','notes','rowers']
widgets = {
'startdate': AdminDateWidget(),
- 'enddate': AdminDateWidget()
+ 'enddate': AdminDateWidget(),
+ 'notes': forms.Textarea()
}
def __init__(self,*args, **kwargs):
diff --git a/rowers/templates/trainingplan.html b/rowers/templates/trainingplan.html
index 1a8c8d8e..181f22cc 100644
--- a/rowers/templates/trainingplan.html
+++ b/rowers/templates/trainingplan.html
@@ -24,6 +24,11 @@
The training plan target is: {{ plan.target.name }} on {{ plan.target.date }}.
{% endif %}
+
+Notes
+
+ {{ plan.notes }}
+
{% if plan|mayeditplan:request %}
Edit the plan
{% endif %}
@@ -303,7 +308,7 @@
{% if todays_date <= microcycle.enddate %}
- {% if microcycle.plan.type == 'userdefined' %}
+ {% if microcycle.plan.type == 'userdefined' %}
@@ -381,7 +386,7 @@
- {% if microcycle|mayeditplan:request %}
+ {% if microcycle|mayeditplan:request %}
edit
/
delete
@@ -427,7 +432,7 @@
The gray "filler"
cycles are generated, adjusted and deleted automatically to
ensure the entire plan
- duration is covered with non-overlapping cycles.
+ duration is covered with non-overlapping cycles.
Once you edit a filler cycle, it become a user-defined
cycle, which cannot be deleted
by the system.
diff --git a/rowers/views/planviews.py b/rowers/views/planviews.py
index 2dcf28b9..c820b2ae 100644
--- a/rowers/views/planviews.py
+++ b/rowers/views/planviews.py
@@ -1557,7 +1557,7 @@ def plannedsession_totemplate_view(request,id=0):
ps.enddate = datetime.date(1970,1,1)
ps.save()
- url = reverse(plannedsession_create_view,kwargs={'userid':request.user.id})
+ url = reverse(plannedsession_create_view,kwargs={'userid':r.user.id})
startdatestring = startdate.strftime('%Y-%m-%d')
enddatestring = enddate.strftime('%Y-%m-%d')
@@ -2021,6 +2021,7 @@ def rower_create_trainingplan(request,userid=0):
startdate = form.cleaned_data['startdate']
status = form.cleaned_data['status']
enddate = form.cleaned_data['enddate']
+ notes = form.cleaned_data['notes']
try:
athletes = form.cleaned_data['rowers']
@@ -2033,6 +2034,7 @@ def rower_create_trainingplan(request,userid=0):
manager=themanager,
startdate=startdate,
enddate=enddate,status=status,
+ notes=notes,
)
p.save()
From ff8b8d5d77336c9cf712b3be1337d161c92401bd Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Sun, 15 Dec 2019 11:44:20 +0100
Subject: [PATCH 3/8] makes fb button load every time
---
templates/newbase.html | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/templates/newbase.html b/templates/newbase.html
index 97ec84b8..25408bcf 100644
--- a/templates/newbase.html
+++ b/templates/newbase.html
@@ -56,6 +56,12 @@
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.10&appId=694685920739849";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
+
From 9a3c8b95babc8da8f9a5261334a45f9b4fc68ebd Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Mon, 16 Dec 2019 11:10:40 +0100
Subject: [PATCH 5/8] a bit more logic navigating the training planning
functions
---
rowers/templates/plannedsessioncreate.html | 14 ++---
rowers/templates/plannedsessionscoach.html | 14 ++---
.../templates/plannedsessionteamcreate.html | 51 ++++++++++---------
rowers/templates/plannedsessionteamedit.html | 19 ++++---
rowers/templates/rower_form.html | 5 +-
5 files changed, 56 insertions(+), 47 deletions(-)
diff --git a/rowers/templates/plannedsessioncreate.html b/rowers/templates/plannedsessioncreate.html
index b2056844..5c5f7ff1 100644
--- a/rowers/templates/plannedsessioncreate.html
+++ b/rowers/templates/plannedsessioncreate.html
@@ -35,7 +35,7 @@
Please correct the error{{ form.errors|pluralize }} below.
{% endif %}
-
+
@@ -89,9 +89,9 @@
Delete
-
- Save
-
+
+ Save
+
{% endfor %}
@@ -144,7 +144,7 @@
$("td #id_course").hide();
$("th label[for='id_course']").hide();
-
+
$("td #id_sessionmode").change(function() {
if (this.value == 'TRIMP') {
@@ -192,7 +192,7 @@
$("th label[for='id_course']").hide();
$("td #id_course").hide();
}
-
+
if (this.value == 'challenge') {
$("td #id_criterium").prop("value","minimum");
$('#id_guidance').html("For Challenges, the default criterium is 'At Least'
");
@@ -228,7 +228,7 @@
}
- );
+ );
diff --git a/rowers/templates/plannedsessionscoach.html b/rowers/templates/plannedsessionscoach.html
index 23540b2d..cc9a747a 100644
--- a/rowers/templates/plannedsessionscoach.html
+++ b/rowers/templates/plannedsessionscoach.html
@@ -23,14 +23,14 @@
- Back by
+ Back by
{{ timeperiod|timedeltadays }} days
- Forward by
+ Forward by
{{ timeperiod|timedeltadays }} days
-
+
@@ -80,7 +80,7 @@
{% endfor %}
- {% endfor %}
+ {% endfor %}
@@ -129,7 +129,7 @@
{% else %}
No Name
-
+
{% endif %}
{% else %}
@@ -144,7 +144,7 @@
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
{{ workout.averagehr }}
{{ workout.maxhr }}
-
+
{% endfor %}
@@ -153,7 +153,7 @@
{% endif %}
-
+
diff --git a/rowers/templates/plannedsessionteamcreate.html b/rowers/templates/plannedsessionteamcreate.html
index 0c674ef1..2cba5493 100644
--- a/rowers/templates/plannedsessionteamcreate.html
+++ b/rowers/templates/plannedsessionteamcreate.html
@@ -19,10 +19,10 @@
- Back by
+ Back by
{{ timeperiod|timedeltadays }} days
- Forward by
+ Forward by
{{ timeperiod|timedeltadays }} days
@@ -34,21 +34,21 @@
Please correct the error{{ form.errors|pluralize }} below.
{% endif %}
-
+
{% csrf_token %}
-
+
New Team Session
- {{ teamform.as_table }}
+ {{ teamform.as_table }}
-
+
{% if plannedsessions %}
@@ -90,15 +90,18 @@
Clone
-
+
Delete
+
+ Save
+
{% endfor %}
-
+
{% endif %}
@@ -150,7 +153,7 @@
$(document).ready(function(){
$("td #id_course").hide();
$("th label[for='id_course']").hide();
-
+
$("td #id_sessionmode").change(function() {
if (this.value == 'TRIMP') {
@@ -165,16 +168,16 @@
$("td #id_sessionunit").prop("value","min");
$('#id_guidance').html("Time: Set value to minutes
");
}
-
+
if (this.value == 'rScore') {
$("td #id_sessionunit").prop("value","None");
$('#id_guidance').html("rScore has no unit
");
}
-
+
});
-
+
$("td #id_sessiontype").change(function() {
-
+
if (this.value == 'session') {
$("td #id_criterium").prop("value","none");
$('#id_guidance').html("For Training Sessions, the default criterium is 'Approximately'
");
@@ -205,18 +208,18 @@
$("td #id_criterium").prop("value","minimum");
$('#id_guidance').html("For Challenges, the default criterium is 'At Least'
");
}
-
+
if (this.value == 'cycletarget') {
$("td #id_criterium").prop("value","none");
$('#id_guidance').html("For Cycle Targets, the default criterium is 'Approximately'
");
}
-
+
}
-
+
);
-
+
$("td #id_sessionunit").change(function() {
-
+
if (this.value == 'm') {
$("td #id_sessionmode").prop("value","distance");
$('#id_guidance').html("Mode was set to distance
");
@@ -233,13 +236,13 @@
$("td #id_sessionmode").prop("value","time");
$('#id_guidance').html("Mode was set to time
");
}
-
+
}
-
- );
-
-
-
+
+ );
+
+
+
});
diff --git a/rowers/templates/plannedsessionteamedit.html b/rowers/templates/plannedsessionteamedit.html
index 5bec388a..160a374e 100644
--- a/rowers/templates/plannedsessionteamedit.html
+++ b/rowers/templates/plannedsessionteamedit.html
@@ -19,10 +19,10 @@
- Back by
+ Back by
{{ timeperiod|timedeltadays }} days
- Forward by
+ Forward by
{{ timeperiod|timedeltadays }} days
@@ -41,10 +41,10 @@
Selecting a team assigns this session to all members of the team.
Unselecting a team does not remove rowers
- who are already assigned to this session. Use the Rowers selection for that.
+ who are already assigned to this session. Use the Rowers selection for that.
- {{ teamform.as_table }}
+ {{ teamform.as_table }}
@@ -112,15 +112,18 @@
Clone
-
+
Delete
+
+ Save
+
{% endfor %}
-
+
{% endif %}
@@ -134,7 +137,7 @@
$(document).ready(function(){
var o = $("td #id_sessiontype").find(":selected").val();
-
+
if (o != 'coursetest') {
$("td #id_course").hide();
$("th label[for='id_course']").hide();
@@ -230,7 +233,7 @@
}
- );
+ );
diff --git a/rowers/templates/rower_form.html b/rowers/templates/rower_form.html
index 23c1c456..3097ab60 100644
--- a/rowers/templates/rower_form.html
+++ b/rowers/templates/rower_form.html
@@ -19,6 +19,9 @@
{% endif %}
+
+ Login {{ rower.user }}
+
{% if userform.errors %}
Please correct the error{{ form.errors|pluralize }} below.
@@ -26,7 +29,7 @@
{% endif %}
{% if accountform.errors %}
-
+
{% endif %}