Private
Public Access
1
0

virtualevent.html progressing

This commit is contained in:
Sander Roosendaal
2018-04-19 07:43:13 +02:00
parent e62e20a091
commit 8bb50596a2
3 changed files with 59 additions and 31 deletions

View File

@@ -481,3 +481,13 @@ def update_virtualrace(ps,cd):
ps.save()
return 1,'Virtual Race Updated'
def race_rower_status(r,race):
ws = Workout.objects.filter(user=r,plannedsession=race)
is_complete = is_session_complete_ws(ws,race)[1]
has_registered = r in race.rower
return is_complete,has_registered

View File

@@ -21,37 +21,50 @@
<div class="grid_12 alpha">
<div class="grid_8 alpha">
<h2>Race Information</h2>
<p>
<table class="listtable shortpadded" width="80%">
<tbody>
<tr>
<th>Course</th><td>{{ race.course }}</td>
</tr>
<tr>
<th>Date</th><td>{{ race.startdate }}</td>
</tr>
<tr>
<th>Race Window</th><td>{{ race.startdate }} {{ race.start_time }} to {{ race.enddate }} {{ race.end_time }}</td>
</tr>
<tr>
<th>Results Submission Deadline</th><td>{{ race.evaluation_closure }}</td>
</tr>
<tr>
<th>Organizer</th><td>{{ race.manager.first_name }} {{ race.manager.last_name }}</td>
</tr>
<tr>
<th>Contact Email</th><td>{{ race.contact_email }}</td>
</tr>
<tr>
<th>Contact Phone</th><td>{{ race.contact_phone }}</td>
</tr>
<tr>
<th>Comment</th><td>{{ race.comment }}</td>
</tr>
</tbody>
</table>
</p>
<div id="raceinfo">
<h2>Race Information</h2>
<p>
<table class="listtable shortpadded" width="80%">
<tbody>
<tr>
<th>Course</th><td>{{ race.course }}</td>
</tr>
<tr>
<th>Date</th><td>{{ race.startdate }}</td>
</tr>
<tr>
<th>Race Window</th><td>{{ race.startdate }} {{ race.start_time }} to {{ race.enddate }} {{ race.end_time }}</td>
</tr>
<tr>
<th>Results Submission Deadline</th><td>{{ race.evaluation_closure }}</td>
</tr>
<tr>
<th>Organizer</th><td>{{ race.manager.first_name }} {{ race.manager.last_name }}</td>
</tr>
<tr>
<th>Contact Email</th><td>{{ race.contact_email }}</td>
</tr>
<tr>
<th>Contact Phone</th><td>{{ race.contact_phone }}</td>
</tr>
<tr>
<th>Comment</th><td>{{ race.comment }}</td>
</tr>
</tbody>
</table>
</p>
</div>
<div id="registerbuttons">
<p>
hier komen de registratieknoppen en zo
</p>
</div>
<div id="results">
<h2>Results</h2>
<p>
No results yet
</p>
</div>
</div>
<div class="grid_4 omega">
<h2>Course</h2>

View File

@@ -13367,6 +13367,7 @@ def virtualevents_view(request):
else:
form = VirtualRaceSelectForm()
return render(request,'virtualevents.html',
{ 'races':races,
@@ -13383,6 +13384,8 @@ def virtualevent_view(request,id=0):
raise Http404("Virtual Race does not exist")
script,div = course_map(race.course)
is_complete,has_registered = race_rower_status(r,race)
return render(request,'virtualevent.html',
{
@@ -13390,6 +13393,8 @@ def virtualevent_view(request,id=0):
'coursediv':div,
'race':race,
'rower':r
'has_registered':has_registered,
'has_rowed':is_complete,
})
@login_required()