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() ps.save()
return 1,'Virtual Race Updated' 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_12 alpha">
<div class="grid_8 alpha"> <div class="grid_8 alpha">
<h2>Race Information</h2> <div id="raceinfo">
<p> <h2>Race Information</h2>
<table class="listtable shortpadded" width="80%"> <p>
<tbody> <table class="listtable shortpadded" width="80%">
<tr> <tbody>
<th>Course</th><td>{{ race.course }}</td> <tr>
</tr> <th>Course</th><td>{{ race.course }}</td>
<tr> </tr>
<th>Date</th><td>{{ race.startdate }}</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>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>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>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 Email</th><td>{{ race.contact_email }}</td>
<tr> </tr>
<th>Contact Phone</th><td>{{ race.contact_phone }}</td> <tr>
</tr> <th>Contact Phone</th><td>{{ race.contact_phone }}</td>
<tr> </tr>
<th>Comment</th><td>{{ race.comment }}</td> <tr>
</tr> <th>Comment</th><td>{{ race.comment }}</td>
</tbody> </tr>
</table> </tbody>
</p> </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>
<div class="grid_4 omega"> <div class="grid_4 omega">
<h2>Course</h2> <h2>Course</h2>

View File

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