From 249712ee5c7efefa1bf73fd999168bce5049c105 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Sun, 15 Dec 2019 13:37:20 +0100
Subject: [PATCH 1/5] site url to share button
---
rowers/templates/embedded_video.html | 6 +++---
rowers/views/workoutviews.py | 2 ++
templates/newbase.html | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html
index 480dad9d..789eb3c5 100644
--- a/rowers/templates/embedded_video.html
+++ b/rowers/templates/embedded_video.html
@@ -44,7 +44,7 @@
function copyText() {
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
- tempInput.value = "https://rowsandall.com/rowers/video/{{ analysis.id|encode }}/";
+ tempInput.value = "{{ siteurl }}/rowers/video/{{ analysis.id|encode }}/";
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
@@ -123,7 +123,7 @@ function copyText() {
{% if analysis %}
@@ -132,7 +132,7 @@ function copyText() {
diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py
index befac25e..6e7b8545 100644
--- a/rowers/views/workoutviews.py
+++ b/rowers/views/workoutviews.py
@@ -156,6 +156,7 @@ def workout_video_view(request,id=''):
'locked': True,
'metricsform':metricsform,
'metricsgroups': metricsgroups,
+ 'siteurl': settings.SITE_URL,
})
@@ -265,6 +266,7 @@ def workout_video_create_view(request,id=0):
'metrics':metrics,
'metricsgroups': metricsgroups,
'locked': False,
+ 'siteurl': settings.SITE_URL,
})
# Show the EMpower Oarlock generated Stroke Profile
diff --git a/templates/newbase.html b/templates/newbase.html
index 25408bcf..3b6f4e2a 100644
--- a/templates/newbase.html
+++ b/templates/newbase.html
@@ -58,7 +58,7 @@
}(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 2/5] 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 %}