Merge branch 'release/v14.33'
This commit is contained in:
@@ -2131,8 +2131,8 @@ regularsessiontypechoices = (
|
|||||||
('test','Mandatory Test'),
|
('test','Mandatory Test'),
|
||||||
('cycletarget','Total for a time period'),
|
('cycletarget','Total for a time period'),
|
||||||
('coursetest','OTW test over a course'),
|
('coursetest','OTW test over a course'),
|
||||||
('fastest_distance','Finds fastest time over a given distance'),
|
('fastest_distance','Finds fastest time over a given distance on the water'),
|
||||||
('fastest_time','Finds largest distance rowed over a given time'),
|
('fastest_time','Finds largest distance rowed on the water over a given time'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# model for Planned Session (Workout, Challenge, Test)
|
# model for Planned Session (Workout, Challenge, Test)
|
||||||
@@ -2145,8 +2145,8 @@ class PlannedSession(models.Model):
|
|||||||
('test','Mandatory Test'),
|
('test','Mandatory Test'),
|
||||||
('cycletarget','Total for a time period'),
|
('cycletarget','Total for a time period'),
|
||||||
('coursetest','OTW test over a course'),
|
('coursetest','OTW test over a course'),
|
||||||
('fastest_distance','Finds fastest time over a given distance'),
|
('fastest_distance','Finds fastest time over a given distance on the water'),
|
||||||
('fastest_time','Finds largest distance rowed over a given time'),
|
('fastest_time','Finds largest distance rowed on the water over a given time'),
|
||||||
('race','Virtual challenge'),
|
('race','Virtual challenge'),
|
||||||
('indoorrace','Indoor Virtual challenge'),
|
('indoorrace','Indoor Virtual challenge'),
|
||||||
)
|
)
|
||||||
@@ -2157,8 +2157,8 @@ class PlannedSession(models.Model):
|
|||||||
('test','Mandatory Test'),
|
('test','Mandatory Test'),
|
||||||
('cycletarget','Total for a time period'),
|
('cycletarget','Total for a time period'),
|
||||||
('coursetest','OTW test over a course'),
|
('coursetest','OTW test over a course'),
|
||||||
('fastest_distance','Finds fastest time over a given distance'),
|
('fastest_distance','Finds fastest time over a given distance on the water'),
|
||||||
('fastest_time','Finds largest distance rowed over a given time'),
|
('fastest_time','Finds largest distance rowed on the water over a given time'),
|
||||||
)
|
)
|
||||||
|
|
||||||
sessionmodechoices = (
|
sessionmodechoices = (
|
||||||
@@ -2838,8 +2838,8 @@ class PlannedSessionFormSmall(ModelForm):
|
|||||||
('test','Mandatory Test'),
|
('test','Mandatory Test'),
|
||||||
('cycletarget','Total for a time period'),
|
('cycletarget','Total for a time period'),
|
||||||
('coursetest','OTW test over a course'),
|
('coursetest','OTW test over a course'),
|
||||||
('fastest_distance','Finds fastest time over a given distance'),
|
('fastest_distance','Finds fastest time over a given distance on the water'),
|
||||||
('fastest_time','Finds largest distance rowed over a given time'),
|
('fastest_time','Finds largest distance rowed on the water over a given time'),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ def add_workouts_plannedsession(ws,ps,r):
|
|||||||
duration = to_time(1000.*fastest_milliseconds)
|
duration = to_time(1000.*fastest_milliseconds)
|
||||||
|
|
||||||
record = CourseTestResult(
|
record = CourseTestResult(
|
||||||
userid=w.user.id,
|
userid=w.user.user.id,
|
||||||
plannedsession = ps,
|
plannedsession = ps,
|
||||||
duration = duration,
|
duration = duration,
|
||||||
coursecompleted = True,
|
coursecompleted = True,
|
||||||
@@ -418,7 +418,7 @@ def add_workouts_plannedsession(ws,ps,r):
|
|||||||
record.save()
|
record.save()
|
||||||
else:
|
else:
|
||||||
record = CourseTestResult(
|
record = CourseTestResult(
|
||||||
userid = w.user.id,
|
userid = w.user.user.id,
|
||||||
workoutid=w.id,
|
workoutid=w.id,
|
||||||
plannedsession = ps,
|
plannedsession = ps,
|
||||||
duration = dt.time(0,0),
|
duration = dt.time(0,0),
|
||||||
@@ -438,7 +438,7 @@ def add_workouts_plannedsession(ws,ps,r):
|
|||||||
duration = dt.time(0,ps.sessionvalue)
|
duration = dt.time(0,ps.sessionvalue)
|
||||||
|
|
||||||
record = CourseTestResult(
|
record = CourseTestResult(
|
||||||
userid=w.user.id,
|
userid=w.user.user.id,
|
||||||
workoutid=w.id,
|
workoutid=w.id,
|
||||||
plannedsession = ps,
|
plannedsession = ps,
|
||||||
duration = duration,
|
duration = duration,
|
||||||
@@ -448,7 +448,7 @@ def add_workouts_plannedsession(ws,ps,r):
|
|||||||
record.save()
|
record.save()
|
||||||
else:
|
else:
|
||||||
record = CourseTestResult(
|
record = CourseTestResult(
|
||||||
userid = w.user.id,
|
userid = w.user.user.id,
|
||||||
plannedsession = ps,
|
plannedsession = ps,
|
||||||
workoutid=w.id,
|
workoutid=w.id,
|
||||||
duration = dt.time(0,ps.sessionvalue),
|
duration = dt.time(0,ps.sessionvalue),
|
||||||
|
|||||||
117
rowers/templates/fastestvirtualeventcreate.html
Normal file
117
rowers/templates/fastestvirtualeventcreate.html
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
{% extends "newbase.html" %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
{% block title %}New Virtual Challenge{% endblock %}
|
||||||
|
|
||||||
|
{% block main %}
|
||||||
|
|
||||||
|
<h1>New On-The-Water Virtual Challenge</h1>
|
||||||
|
|
||||||
|
<ul class="main-content">
|
||||||
|
<li class="grid_4">
|
||||||
|
<p>With this form, you can create a new virtual challenge. After you submit
|
||||||
|
the form, the challenge is created and will be visible to all users. From
|
||||||
|
that moment, only the site admin can delete the challenge
|
||||||
|
(admin@rowsandall.com). You can still edit the challenge until
|
||||||
|
the start of the challenge window.
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="grid_3">
|
||||||
|
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
|
{% if form.errors %}
|
||||||
|
<p style="color: red;">
|
||||||
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
<p>
|
||||||
|
<table class="djangoform">
|
||||||
|
{{ form.as_table }}
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="submit" value="Save">
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
<li class="grid_1">
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<p>All times are local times in the time zone you select</p>
|
||||||
|
<p>Adding a contact phone number and email is not mandatory, but we
|
||||||
|
strongly recommend it.</p>
|
||||||
|
<p>If your event has a registration closure deadline, participants
|
||||||
|
have to enter (and can withdraw) before the registration closure time.</p>
|
||||||
|
<p>Participants can submit results until the evaluation closure time.</p>
|
||||||
|
<p>Until one hour after evaluation closure time, the challenge organizer
|
||||||
|
can review and reject submitted results ("disqualification"). If
|
||||||
|
you as the challenge organizer intend to use this functionality, it
|
||||||
|
is strongly recommended that you fill out a contact email or phone
|
||||||
|
number.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The participants can row this challenge on any course, and their fastest time
|
||||||
|
over the challenge distance (respectively the largest distance achieved over the
|
||||||
|
challenge duration) is automatically extracted from the workout. No
|
||||||
|
need to program a set piece.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Standard Times are a way to compare results in a race category with
|
||||||
|
a course record or golden standard for that event. A point score is calculated
|
||||||
|
which compares the participant's result with the standard. This offers an
|
||||||
|
engaging way to compete on points across different categories, boat types, and skill
|
||||||
|
levels.
|
||||||
|
If you select a Standard Times set from the drop-down list, race categories will
|
||||||
|
be limited to those in the selected set of Standard Times.
|
||||||
|
</p>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
|
<script type='text/javascript'
|
||||||
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
$('#id_registration_form').change(function(){
|
||||||
|
|
||||||
|
var value = $(this).val();
|
||||||
|
|
||||||
|
if (value == 'windowstart') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_startdate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_start_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'windowend') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_enddate').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_end_time').val());
|
||||||
|
|
||||||
|
} else if (value == 'deadline') {
|
||||||
|
|
||||||
|
$('#id_registration_closure_0').val($('#id_evaluation_closure_0').val());
|
||||||
|
|
||||||
|
$('#id_registration_closure_1').val($('#id_evaluation_closure_1').val());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'menu_racing.html' %}
|
||||||
|
{% endblock %}
|
||||||
@@ -207,6 +207,21 @@
|
|||||||
$("td #id_course").hide();
|
$("td #id_course").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.value == 'fastest_distance') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$("td #id_sessionmode").prop("value","distance")
|
||||||
|
$('#id_guidance').html("<p>For Fastest Distance, set an exact number of meters</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'fastest_time') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$("td #id_sessionmode").prop("value","time")
|
||||||
|
$('#id_guidance').html("<p>For Fastest Time, set an exact number of minutes</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.value == 'challenge') {
|
if (this.value == 'challenge') {
|
||||||
$("td #id_criterium").prop("value","minimum");
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
|||||||
Reference in New Issue
Block a user