first result working
This commit is contained in:
@@ -2252,7 +2252,7 @@ class VirtualRace(PlannedSession):
|
||||
validators=[validate_email],blank=True)
|
||||
|
||||
coursestandards = models.ForeignKey(StandardCollection,null=True,on_delete=models.SET_NULL,
|
||||
verbose_name='Standard Times')
|
||||
verbose_name='Standard Times',blank=True)
|
||||
|
||||
def __str__(self):
|
||||
|
||||
@@ -2954,6 +2954,7 @@ class VirtualRaceResult(models.Model):
|
||||
|
||||
startsecond = models.FloatField(default=0)
|
||||
endsecond = models.FloatField(default=0)
|
||||
referencespeed = models.FloatField(default=5.0)
|
||||
entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL,
|
||||
verbose_name='Group')
|
||||
|
||||
|
||||
@@ -1514,6 +1514,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
||||
return 0,comments,errors,0
|
||||
|
||||
if ws[0].workouttype != record.boatclass:
|
||||
print(ws[0].workouttype,record.boatclass)
|
||||
errors.append('Your workout boat class is different than on your race registration')
|
||||
return 0,comments,errors,0
|
||||
|
||||
@@ -1551,7 +1552,8 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0):
|
||||
comments.append('Workouts submitted to virtual events have to be public. We have changed the workout to a public workout.')
|
||||
|
||||
job = myqueue(queue,handle_check_race_course,ws[0].csvfilename,
|
||||
ws[0].id,race.course.id,record.id,splitsecond=splitsecond)
|
||||
ws[0].id,race.course.id,record.id,splitsecond=splitsecond,
|
||||
referencespeed=record.referencespeed)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@ def save_scoring(name,user,filename,id=0,notes=""):
|
||||
collection.name = name
|
||||
collection.notes = notes
|
||||
collection.save()
|
||||
standards = CourseStandard.objects.filter(standardcollection=collection)
|
||||
for standard in standards:
|
||||
print(standard,collection)
|
||||
standard.delete()
|
||||
|
||||
except StandardCollection.DoesNotExist:
|
||||
return 0
|
||||
@@ -56,6 +60,20 @@ def save_scoring(name,user,filename,id=0,notes=""):
|
||||
|
||||
try:
|
||||
boatclass = row['BoatClass']
|
||||
if boatclass.lower() in ['standard','olympic','normal']:
|
||||
boatclass = 'water'
|
||||
elif boatclass.lower() in ['erg','c2','concept','static']:
|
||||
boatclass = 'rower'
|
||||
elif boatclass.lower() in ['dynamic']:
|
||||
boatclass = 'dynamic'
|
||||
elif boatclass.lower() in ['slides','slide','slider','sliders']:
|
||||
boatclass = 'slides'
|
||||
elif boatclass.lower() in ['c','c-boat']:
|
||||
boatclass = 'c-boat'
|
||||
elif boatclass.lower() in ['coastal','coast']:
|
||||
boatclass = 'coastal'
|
||||
elif boatclass.lower() in ['church','churchboat','finnish','finland']:
|
||||
boatclass = 'churchboat'
|
||||
except KeyError:
|
||||
boatclass = 'water'
|
||||
|
||||
|
||||
@@ -353,6 +353,16 @@ def handle_check_race_course(self,
|
||||
else:
|
||||
splitsecond = 0
|
||||
|
||||
if 'referencespeed' in kwargs:
|
||||
referencespeed = kwargs['referencespeed']
|
||||
else:
|
||||
referencespeed = 5.0
|
||||
|
||||
if 'coursedistance' in kwargs:
|
||||
coursedistance = kwargs['coursedistance']
|
||||
else:
|
||||
coursedistance = 0
|
||||
|
||||
mode = 'race'
|
||||
if 'mode' in kwargs:
|
||||
mode = kwargs['mode']
|
||||
@@ -479,22 +489,28 @@ def handle_check_race_course(self,
|
||||
else:
|
||||
coursecompleted = False
|
||||
|
||||
|
||||
points = 0
|
||||
if coursecompleted:
|
||||
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
||||
if coursedistance == 0:
|
||||
coursedistance = coursemeters
|
||||
velo = coursedistance/coursetimeseconds
|
||||
points = int(100*(2.-referencespeed/velo))
|
||||
query = 'UPDATE rowers_virtualraceresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||
recordid=recordid,
|
||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||
distance=int(coursemeters),
|
||||
points=points,
|
||||
workoutid=workoutid,
|
||||
startsecond=startsecond,
|
||||
endsecond=endsecond,
|
||||
)
|
||||
|
||||
if mode == 'coursetest':
|
||||
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond} WHERE id={recordid}'.format(
|
||||
query = 'UPDATE rowers_coursetestresult SET coursecompleted = 1, duration = "{duration}", distance = {distance}, workoutid = {workoutid}, startsecond = {startsecond}, endsecond = {endsecond}, points={points} WHERE id={recordid}'.format(
|
||||
recordid=recordid,
|
||||
duration=totaltime_sec_to_string(coursetimeseconds),
|
||||
distance=int(coursemeters),
|
||||
points=points,
|
||||
workoutid=workoutid,
|
||||
startsecond=startsecond,
|
||||
endsecond=endsecond,
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
$.ajax({
|
||||
data: data,
|
||||
type: $(this).attr('method'),
|
||||
url: '/rowers/standards/upload/',
|
||||
url: window.location.pathname,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
error: function(result) {
|
||||
|
||||
@@ -268,7 +268,9 @@
|
||||
<th> </th>
|
||||
<th>Name</th>
|
||||
<th>Team Name</th>
|
||||
<th> </th>
|
||||
{% if race.coursestandards %}
|
||||
<th>Group</th>
|
||||
{% else %}
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
@@ -276,8 +278,12 @@
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<th>Boat</th>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<th>Time</th>
|
||||
<th>Distance</th>
|
||||
{% if race.coursestandards %}
|
||||
<th>Points</th>
|
||||
{% endif %}
|
||||
<th>Details</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
@@ -290,6 +296,9 @@
|
||||
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
|
||||
{{ result.username }}</a></td>
|
||||
<td>{{ result.teamname }}</td>
|
||||
{% if race.coursestandards %}
|
||||
<td>{{ result.entrycategory }}</td>
|
||||
{% else %}
|
||||
<td>{{ result.age }}</td>
|
||||
<td>{{ result.sex }}</td>
|
||||
<td>{{ result.weightcategory }}</td>
|
||||
@@ -304,11 +313,17 @@
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>{{ result.boattype }}</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<td>{{ result.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||
<td>{{ result.distance }} m</td>
|
||||
{% if race.coursestandards %}
|
||||
<td>{{ result.points }}</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
|
||||
Details</a></td>
|
||||
Details</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{% if race.manager == request.user and not race|is_final %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/disqualify/{{ result.id }}/">
|
||||
@@ -394,22 +409,29 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Team Name</th>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<th>Class</th>
|
||||
<th>Boat</th>
|
||||
{% if race.coursestandards %}
|
||||
<th>Group</th>
|
||||
<th>Age</th>
|
||||
{% else %}
|
||||
<th>Class</th>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<th>Boat</th>
|
||||
{% endif %}
|
||||
<th>Class</th>
|
||||
<th>Age</th>
|
||||
<th>Gender</th>
|
||||
<th>Weight Category</th>
|
||||
<th>Adaptive</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tbody>
|
||||
{% for record in records %}
|
||||
<tr>
|
||||
<td>{{ record.username }}
|
||||
<td>{{ record.teamname }}</td>
|
||||
{% if race.coursestandards %}
|
||||
<td>{{ record.entrycategory }}</td>
|
||||
<td>{{ record.age }}</td>
|
||||
{% else %}
|
||||
<td>{{ record.boatclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>{{ record.boattype }}</td>
|
||||
@@ -424,6 +446,7 @@
|
||||
{{ record.adaptiveclass }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if record.userid == rower.id and 'withdrawbutton' in buttons %}
|
||||
<td>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/withdraw/{{ record.id }}" >Withdraw</a>
|
||||
|
||||
@@ -525,6 +525,7 @@ def course_upload_view(request):
|
||||
@login_required()
|
||||
def standards_upload_view(request,id=0):
|
||||
is_ajax = False
|
||||
print(id,'aap')
|
||||
if request.is_ajax():
|
||||
is_ajax = True
|
||||
r = getrower(request.user)
|
||||
@@ -573,6 +574,8 @@ def standards_upload_view(request,id=0):
|
||||
messages.error(request,'Form is not valid')
|
||||
return render(request,'standard_form.html',
|
||||
{'form':form,
|
||||
'active':'nav-racing',
|
||||
'id':id,
|
||||
})
|
||||
|
||||
else:
|
||||
@@ -587,6 +590,7 @@ def standards_upload_view(request,id=0):
|
||||
return render(request,'standard_form.html',
|
||||
{'form':form,
|
||||
'active':'nav-racing',
|
||||
'id':id,
|
||||
})
|
||||
return {'result':0}
|
||||
|
||||
@@ -1127,8 +1131,6 @@ def virtualevent_view(request,id=0):
|
||||
else:
|
||||
form = None
|
||||
|
||||
|
||||
|
||||
breadcrumbs = [
|
||||
{
|
||||
'url':reverse('virtualevents_view'),
|
||||
@@ -1687,6 +1689,7 @@ def virtualevent_register_view(request,id=0):
|
||||
sex=sex,
|
||||
age=age,
|
||||
entrycategory=coursestandard,
|
||||
referencespeed=referencespeed,
|
||||
)
|
||||
|
||||
record.save()
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 62.5%;
|
||||
font-size: 62.5%;
|
||||
margin: 0px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
@@ -96,13 +96,13 @@ cox {
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
th {
|
||||
th {
|
||||
font-weight: bold;
|
||||
align: left;
|
||||
}
|
||||
|
||||
.listtable tbody tr:nth-of-type(even) { background-color: #DDD; }
|
||||
.listtable thead th {
|
||||
.listtable thead th {
|
||||
font-weight: bold;
|
||||
align: left;
|
||||
}
|
||||
@@ -112,6 +112,10 @@ th {
|
||||
|
||||
.paddedtable td { padding: 1px 20px }
|
||||
|
||||
.shortpadded th { padding: 3px 3px }
|
||||
|
||||
.paddedtable th { padding: 1px 20px }
|
||||
|
||||
.cortable {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
@@ -124,12 +128,12 @@ th {
|
||||
|
||||
th.rotate {
|
||||
/* Something you can count on */
|
||||
height: 120px;
|
||||
height: 120px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th.rotate > div {
|
||||
transform:
|
||||
transform:
|
||||
/* Magic Numbers */
|
||||
translate(28px, 91px)
|
||||
/* 45 is really 360 - 45 */
|
||||
@@ -141,12 +145,12 @@ th.rotate > div > span {
|
||||
padding: 5px 5px;
|
||||
}
|
||||
|
||||
.fixtable table {
|
||||
.fixtable table {
|
||||
table-layout: fixed;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.message {
|
||||
.message {
|
||||
border: 1px solid #000;
|
||||
background-color: #f88;
|
||||
font-weight: bold;
|
||||
@@ -172,7 +176,7 @@ th.rotate > div > span {
|
||||
background-color: #fee;
|
||||
}
|
||||
|
||||
.successmessage {
|
||||
.successmessage {
|
||||
border: 1px solid #000;
|
||||
background-color: #8f8;
|
||||
color: #000;
|
||||
@@ -180,7 +184,7 @@ th.rotate > div > span {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.deletelink {
|
||||
.deletelink {
|
||||
border: 1px solid #000;
|
||||
background-color: #f88;
|
||||
color: #000;
|
||||
@@ -189,7 +193,7 @@ th.rotate > div > span {
|
||||
}
|
||||
|
||||
.navbar {
|
||||
border: 1px solid #666;
|
||||
border: 1px solid #666;
|
||||
color: #000;
|
||||
|
||||
|
||||
@@ -199,7 +203,7 @@ th.rotate > div > span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.navbutton {
|
||||
.navbutton {
|
||||
background-color: #ddd;
|
||||
-moz-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
@@ -242,7 +246,7 @@ th.rotate > div > span {
|
||||
transition-delay:1s;
|
||||
}
|
||||
|
||||
.caption {
|
||||
.caption {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -263,7 +267,7 @@ th.rotate > div > span {
|
||||
font: 1.0em/1.2em sans-serif;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: .2em .5em .2em .5em;
|
||||
padding: .2em .5em .2em .5em;
|
||||
zoom: 1;
|
||||
/* border-radius: .5em; */
|
||||
/* -moz-border-radius: .5em; */
|
||||
@@ -276,7 +280,7 @@ th.rotate > div > span {
|
||||
font: 1.0em/1.2em sans-serif;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: .2em .5em .2em .5em;
|
||||
padding: .2em .5em .2em .5em;
|
||||
zoom: 1;
|
||||
/* border-radius: .5em; */
|
||||
/* -moz-border-radius: .5em; */
|
||||
@@ -304,7 +308,7 @@ th.rotate > div > span {
|
||||
}
|
||||
|
||||
.dot:hover {
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.rounder {
|
||||
@@ -345,9 +349,9 @@ th.rotate > div > span {
|
||||
-webkit-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
-moz-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
|
||||
|
||||
line-height: 0; /* ensure no space between bottom */
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vignet img {
|
||||
@@ -367,9 +371,9 @@ th.rotate > div > span {
|
||||
-webkit-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
-moz-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4);
|
||||
|
||||
|
||||
line-height: 0; /* ensure no space between bottom */
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vignet2 img {
|
||||
@@ -751,7 +755,7 @@ th.rotate > div > span {
|
||||
padding: 1em;
|
||||
text-align: left;
|
||||
line-height: 1.5em;
|
||||
word-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.talktext p{
|
||||
/* remove webkit p margins */
|
||||
@@ -776,7 +780,7 @@ th.rotate > div > span {
|
||||
|
||||
/* paleblue */
|
||||
.paleblue {
|
||||
# padding: 8px;
|
||||
# padding: 8px;
|
||||
background: aliceblue;
|
||||
box-shadow:inset 0px 0px 0px 6px #fff;
|
||||
-moz-box-shadow:inset 0px 0px 0px 6px #fff;
|
||||
@@ -948,7 +952,7 @@ th.rotate > div > span {
|
||||
|
||||
|
||||
.greenbar {
|
||||
border: 1px solid #666;
|
||||
border: 1px solid #666;
|
||||
color: #000;
|
||||
|
||||
|
||||
@@ -959,7 +963,7 @@ th.rotate > div > span {
|
||||
}
|
||||
|
||||
|
||||
#footer {
|
||||
#footer {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
@@ -1016,21 +1020,21 @@ th.rotate > div > span {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
|
||||
.flexplot {
|
||||
.flexplot {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
|
||||
a.wh:link {
|
||||
a.wh:link {
|
||||
color: #e9e9e9;
|
||||
}
|
||||
|
||||
a.wh:visited {
|
||||
a.wh:visited {
|
||||
color: #e9e9e9;
|
||||
}
|
||||
|
||||
a.wh:hover {
|
||||
a.wh:hover {
|
||||
color: #e9e9e9;
|
||||
}
|
||||
|
||||
@@ -1067,7 +1071,7 @@ a.wh:hover {
|
||||
|
||||
.icon-link a:hover, a:active, a:visited, a:link {
|
||||
/* color: #1c75bc; */
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -1086,9 +1090,9 @@ a.wh:hover {
|
||||
}
|
||||
|
||||
.mystyle {
|
||||
font-size: 11pt;
|
||||
font-size: 11pt;
|
||||
font-family: Arial;
|
||||
border-collapse: collapse;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid silver;
|
||||
|
||||
}
|
||||
|
||||
2
static/css/rowsandall2.min.css
vendored
2
static/css/rowsandall2.min.css
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user