Private
Public Access
1
0
Files
rowsandall/rowers/templates/virtualevent.html
Sander Roosendaal eec45e8357 fixing upload table
2021-09-28 08:17:08 +02:00

716 lines
25 KiB
HTML

{% extends "newbase.html" %}
{% load static %}
{% load rowerfilters %}
{% load leaflet_tags %}
{% load tz %}
{% block meta %}
{% leaflet_js %}
{% leaflet_css %}
{% endblock %}
{% block title %}Rowsandall Virtual Challenge{% endblock %}
{% block scripts %}
{% include "monitorjobs.html" %}
{% endblock %}
{% block og_title %}{{ race.name }}{% endblock %}
{% block description %}Virtual Rowing Challenge {{ race.name }}{% endblock %}
{% if racelogo %}
{% block og_image %}
<meta property="og:image" content="http://rowsandall.com/{{ racelogo.filename|spacetohtml }}" />
<meta property="og:image:secure_url" content="https://rowsandall.com/{{ racelogo.filename |spacetohtml }}" />
<meta property="og:image:width" content="{{ racelogo.width }}" />
<meta property="og:image:height" content="{{ racelogo.height }}" />
{% endblock %}
{% block image_src %}
<link rel="image_src" href="/{{ racelogo.filename |spacetohtml }}" />
{% endblock %}
{% endif %}
{% block main %}
<h1>{{ race.name }}</h1>
<p>
<div class="fb-share-button"
data-href="{{ request.build_absolute_uri }}"
data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank"
href="https://www.facebook.com/sharer/sharer.php?u={{ request.build_absolute_uri }}">Share</a>
</div>
</p><p>
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="{{ request.build_absolute_uri }}"
{% if race.sessiontype == 'race' %}
data-text="@rowsandall #rowingdata Participate in virtual race '{{ race.name }}'">Tweet</a>
{% else %}
data-text="@rowsandall #rowingdata Participate in Indoor Rowing virtual race '{{ race.name }}'">Tweet</a>
{% endif %}
</p><p>
<a href="https://www.pinterest.com/pin/create/button/"
data-pin-do="buttonBookmark">
</a>
</p>
{% if not racelogo and race.manager == request.user %}
<a href="/rowers/virtualevent/{{ race.id }}/image">Add Race Logo</a>
{% endif %}
<ul class="main-content">
{% if racelogo %}
<li class="grid_2">
<img src="/{{ racelogo.filename }}" alt="{{ racelogo.filename }}" height="100" width="120">
{% if race.manager == request.user %}
<a href="/rowers/virtualevent/{{ race.id }}/image">Edit Image</a>
{% endif %}
</li>
{% endif %}
{% if race.sessiontype == 'race' %}
<li class="grid_2">
<p>
<h2>Course</h2>
</p>
<div class="mapdiv">
{{ coursediv|safe }}
{{ coursescript|safe }}
</div>
</li>
{% endif %}
<li class="grid_2">
{% localtime off %}
<div id="raceinfo">
<p>
<h2>Challenge Information</h2>
</p>
<p>
<table class="listtable shortpadded" width="100%">
<tbody>
{% if race.sessiontype == 'race' %}
<tr>
<th>Course</th><td><a href="/rowers/courses/{{ race.course.id }}">{{ race.course }}</a></td>
</tr>
{% elif race.sessiontype == 'fastest_time' %}
<tr>
<th>Time Challenge</th><td>To be rowed on the water</td>
</tr>
{% elif race.sessiontype == 'fastest_distance' %}
<tr>
<th>Distance Challenge</th><td>To be rowed on the water</td>
</tr>
{% else %}
<tr>
<th>Indoor Race</th><td>To be rowed on a Concept2 ergometer</td>
</tr>
<tr>
<th>Challenge Time Zone</th><td>{{ race.timezone }}</td>
</tr>
{% endif %}
{% if race.coursestandards %}
<tr>
<th>Standard Times</th><td><a href="/rowers/standards/{{ race.coursestandards.id }}/">{{ race.coursestandards }}</a></td>
</tr>
{% endif %}
<tr>
<th>
{{ race.sessionmode }} challenge
</th><td>{{ race.sessionvalue }} {{ race.sessionunit }}
</td>
</tr>
<tr>
<th>Date</th><td>{{ race.startdate|date:"Y-m-d" }}</td>
</tr>
<tr>
<th>Race Window</th><td>{{ race.startdate|date:"Y-m-d" }} {{ race.start_time|time:"H:i e" }} to {{ race.enddate|date:"Y-m-d" }} {{ race.end_time|time:"H:i e" }} ({{ race.timezone }})</td>
</tr>
<tr>
<th>Registration closure</th>
<td>
{% with tz=race.timezone %}
{{ race.registration_closure|timezone:tz |date:"Y-m-d H:i e" }}
{% endwith %}
</td>
</tr>
<tr>
<th>
Results Submission Deadline
</th>
<td>
{% with tz=race.timezone %}
{{ race.evaluation_closure|timezone:tz |date:"Y-m-d H:i e" }}
{% endwith %}</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|linebreaks|urlshorten:"50" }}</td>
</tr>
</tbody>
</table>
</p>
</div>
{% endlocaltime %}
</li>
<li class="grid_4">
<div id="results">
{% if race|is_final %}
<h2>Final Results</h2>
{% else %}
<h2>Results</h2>
{% endif %}
{% if results or dns or dnf %}
<a href="/rowers/virtualevent/{{ race.id }}/compare"
title="Compare the workouts of all competitors"><i class="fas fa-chart-line fa-fw"></i></a>
{% if race.sessiontype == 'race' %}
<a href="/rowers/virtualevent/{{ race.id }}/mapcompare"
title="Compare the courses taken by the competitors"><i class="fas fa-route fa-fw"></i></a>
{% endif %}
{% if race.manager == request.user %}
<a href="/rowers/virtualevent/{{ race.id }}/download"
title="Download Results"><i class="fas fa-file-download fa-fw"></i></a>
{% endif %}
<p>
<table class="listtable shortpadded" style="word-break: break-all">
<thead>
<tr>
<th>&nbsp;</th>
<th>Name</th>
<th>Team Name</th>
{% if race.coursestandards %}
<th>Group</th>
{% else %}
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Class</th>
{% if race.sessiontype == 'race' %}
<th>Boat</th>
{% endif %}
{% endif %}
<th>Time<a href="?order_by=duration">&#9660;</th>
<th>Distance<a href="?order_by=-distance">&#9660;<a href="?order_by=distance">&#9650;</th>
{% if race.coursestandards %}
<th>Points<a href="?order_by=-points">&#9660;</a></th>
{% endif %}
<th>Details</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for result in results %}
<tr>
<td>{{ forloop.counter }}</td>
<td>
{% if race.sessiontype == 'race' %}
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
{{ result.username }}</a>
{% elif race.sessiontype == 'fastest_time' %}
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/nocourse/">
{{ result.username }}</a>
{% elif race.sessiontype == 'fastest_distance' %}
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/nocourse/">
{{ result.username }}</a>
{% else %}
{{ result.username }}
{% endif %}
</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>
<td>
{% if result.adaptiveclass == 'None' %}
&nbsp;
{% else %}
{{ result.adaptiveclass }}
{% endif %}
</td>
<td>{{ result.boatclass }}</td>
{% 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|sigdig:4 }}</td>
{% endif %}
<td>
<a title="Details" href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
<i class="fas fa-search-plus fa-fw"></i></a>
</td>
<td>
{% if result.userid == request.user.rower.id and not race|is_final %}
<a title="Edit" href="/rowers/virtualevent/{{ race.id }}/register/edit/{{ result.id }}">
<i class="fas fa-pencil-alt fa-fw"></i>
</a>
{% endif %}
</td>
<td>
{% if race.manager == request.user and not race|is_final %}
<a title="Disqualify" href="/rowers/virtualevent/{{ race.id }}/disqualify/{{ result.id }}/">
<i class="fas fa-flag-alt fa-fw"></i>
</a>
{% else %}
&nbsp;
{% endif %}
</td>
<td>
{% if result.userid == request.user.rower.id and not race|is_final %}
<a title="Remove" href="/rowers/virtualevent/{{ race.id }}/withdrawresult/{{ result.id }}">
<i class="fas fa-trash-alt fa-fw"></i>
</a>
{% endif %}
</td>
</tr>
{% endfor %}
{% for result in dnf %}
<tr>
<td>&nbsp;</td>
<td>{{ result.username }}</td>
<td>{{ result.teamname }}</td>
{% if race.coursestandards %}
<td>{{ result.entrycategory }}</td>
<td>DNF</td>
<td>DNF</td>
{% else %}
<td>{{ result.age }}</td>
<td>{{ result.sex }}</td>
<td>{{ result.weightcategory }}</td>
<td>
{% if result.adaptiveclass == 'None' %}
&nbsp;
{% else %}
{{ result.adaptiveclass }}
{% endif %}
</td>
<td>{{ result.boatclass }}</td>
{% if race.sessiontype == 'race' %}
<td>{{ result.boattype }}</td>
{% endif %}
{% endif %}
<td>DNF</td>
<td>DNF</td>
<td>
<a href="/rowers/workout/{{ result.workoutid|encode }}/view/entry/{{ result.id }}/">
<i class="fas fa-search-plus fa-fw"></i></a>
</td>
{% if race.manager == request.user %}
<td>&nbsp;</td>
<td>&nbsp;</td>
{% endif %}
</tr>
{% endfor %}
{% for result in dns %}
<tr>
<td>&nbsp;</td>
<td>{{ result.username }}</td>
<td>{{ result.teamname }}</td>
{% if race.coursestandards %}
<td>{{ result.entrycategory }}</td>
<td>DNS</td>
<td>DNS</td>
{% else %}
<td>{{ result.age }}</td>
<td>{{ result.sex }}</td>
<td>{{ result.weightcategory }}</td>
<td>
{% if result.adaptiveclass == 'None' %}
&nbsp;
{% else %}
{{ result.adaptiveclass }}
{% endif %}
</td>
<td>{{ result.boatclass }}</td>
{% if race.sessiontype == 'race' %}
<td>{{ result.boattype }}</td>
{% endif %}
{% endif %}
<td>DNS</td>
</tr>
{% endfor %}
</tbody>
</table>
</p>
{% else %}
<p>
No results yet
</p>
{% endif %}
{% if race.manager == request.user %}
<p>
<a href="/rowers/sessions/{{ race.id }}/message/">Message to participant(s)</a>
</p>
{% endif %}
</div>
</li>
{% if form %}
<li class="grid_4">
<p>
<h2>Filter Results</h2>
</p>
<p>
<form id="result_filter_form", method="post">
<table>
{{ form.as_table }}
</table>
{% csrf_token %}
<input type="submit" value="Submit">
</p>
</li>
{% endif %}
<li class="grid_4">
<div id="registerbuttons">
{% if request.user.is_anonymous %}
<p>
Registered users of rowsandall.com can participate in this challenge.
Participation is free, unless specified differently in the race comment above.
{% if race.sessiontype == 'race' %}
Register to let others know you plan to do this challenge:
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% elif race.sessiontype == 'fastest_time' %}
Register to let others know you plan to do this challenge:
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% elif race.sessiontype == 'fastest_distance' %}
Register to let others know you plan to do this challenge:
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% else %}
<a href="/rowers/virtualevent/{{ race.id }}/registerindoor"><h3>Register</h3></a>
{% endif %}
{% if request.user|isfollower:race.id %}
<a href="/rowers/virtualevent/{{ race.id }}/follow/"><h3>Follow this challenge</h3></a>
{% endif %}
</p>
{% else %}
<p>
See challenge rules below. Participation to this challenge is free,
unless specified differently in the challenge comment above.
</p>
<p>
Note. On this page, all times are local times in the time zone of the challenge.
</p>
<p>
{% for button in buttons %}
{% if button == 'registerbutton' %}
<p>
Register to let others know you plan to do this challenge. This also give you the option to
select your entry category:
{% if race.sessiontype == 'race' %}
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% elif race.sessiontype == 'fastest_time' %}
Register to let others know you plan to do this challenge:
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% elif race.sessiontype == 'fastest_distance' %}
Register to let others know you plan to do this challenge:
<a href="/rowers/virtualevent/{{ race.id }}/register"><h3>Register</h3></a>
{% else %}
<a href="/rowers/virtualevent/{{ race.id }}/registerindoor"><h3>Register</h3></a>
{% endif %}
{% if request.user|isfollower:race.id %}
<a href="/rowers/virtualevent/{{ race.id }}/follow/"><h3>Follow this challenge</h3></a>
{% endif %}
</p>
{% endif %}
{% if button == 'submitbutton' %}
<table width=100% class="shortpadded">
<tr>
<td>
<a href="/rowers/virtualevent/{{ race.id }}/submit">Submit Workout</a>
</td>
<td>
Submit a workout that is already on the site as your challenge result
</td>
</tr>
<tr>
<td>
<a href="/rowers/workout/upload/{{ race.id }}/">Upload your challenge result</a>
</td>
<td>
Upload a new workout to the site and submit it as a result. You
need a workout data file.
</td>
</tr>
{% if race.sessiontype == 'indoorrace' %}
<tr>
<td>
<a href="/rowers/workout/addmanual/{{ race.id }}">Enter your challenge result manually</a>
</td>
<td>
If you don't have a data file, enter the results
manually. If you have a photo of the monitor with the
result, it is recommended to add this to the workout.
</td>
</tr>
{% endif %}
</table>
{% endif %}
{% if button == 'resubmitbutton' %}
<p>
<a href="/rowers/virtualevent/{{ race.id }}/submit">Submit New Result</a>
</p>
{% endif %}
{% if button == 'withdrawbutton' %}
<p>
<a href="/rowers/virtualevent/{{ race.id }}/withdraw">Withdraw</a>
</p>
{% endif %}
{% if button == 'adddisciplinebutton' %}
<p>
<a href="/rowers/virtualevent/{{ race.id }}/adddiscipline">
Register New Boat
</a>
</p>
{% endif %}
{% if button == 'editbutton' %}
<p>
{% if race.sessiontype == 'race' %}
<a href="/rowers/virtualevent/{{ race.id }}/edit">Edit challenge
</a>
{% else %}
<a href="/rowers/virtualevent/{{ race.id }}/editindoor">Edit challenge
</a>
{% endif %}
</p>
{% endif %}
{% endfor %}
{% endif %}
</div>
</li>
<li class="grid_4">
<div id="registered">
{% if records %}
<h2>Registered Competitors</h2>
<table class="listtable shortpadded">
<thead>
<tr>
<th>Name</th>
<th>Team Name</th>
{% if race.coursestandards %}
<th>Group</th>
<th>Age</th>
{% else %}
{% 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>
{% endif %}
<td>{{ record.age }}</td>
<td>{{ record.sex }}</td>
<td>{{ record.weightcategory }}</td>
<td>
{% if record.adaptiveclass == 'None' %}
&nbsp;
{% else %}
{{ record.adaptiveclass }}
{% endif %}
</td>
{% endif %}
{% if record.userid == request.user.rower.id and not race|is_final %}
<td>
<a title="Edit" href="/rowers/virtualevent/{{ race.id }}/register/edit/{{ record.id }}/">
<i class="fas fa-pencil-alt fa-fw"></i>
</a>
</td>
{% endif %}
{% if record.userid == rower.id and 'withdrawbutton' in buttons %}
<td>
<a title="Withdraw" href="/rowers/virtualevent/{{ race.id }}/withdraw/{{ record.id }}" >
<i class="fas fa-trash-alt fa-fw"></i>
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
{% for record in records %}
{% if record.userid == request.user.rower.id and forloop.counter == 1 %}
{% if race.sessiontype == 'race' %}
{% if record.emailnotifications %}
<a href="/rowers/raceregistration/togglenotification/{{ race.id }}">
Unsubscribe from race notifications by email
</a>
{% else %}
<a href="/rowers/raceregistration/togglenotification/{{ race.id }}">
Subscribe to race notifications by email
</a>
{% endif %}
{% else %}
{% if record.emailnotifications %}
<a href="/rowers/indoorraceregistration/togglenotification/{{ race.id }}">
Unsubscribe from challenge notifications by email
</a>
{% else %}
<a href="/rowers/indoorraceregistration/togglenotification/{{ race.id }}">
Subscribe to challenge notifications by email
</a>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</li>
<li class="grid_2">
<div id="comments">
<h2>Comments ({{ comments|length }})</h2>
{% for c in comments %}
<p>
<em>{{ c.user.first_name }} {{ c.user.last_name }}</em> - {{ c.created }}</br>
<q>{{ c.comment }}</q>
</p>
{% endfor %}
<p>
<a href="/rowers/sessions/{{ race.id }}/comments/">Add a comment</a>
</p>
</div>
</li>
<li class="grid_4">
<div id="rules">
<p>
<h2>Rules</h2>
</p>
<p>
Virtual challenges are intended as an informal way to add a
competitive element to training and as a quick way to set
up and manage for example race intensity practices.
</p>
{% if race.sessiontype == 'race' %}
<p>
On the water challenges are rowed on the course shown.
You cannot submit results rowed
on other bodies of water.
</p>
{% elif race.sessiontype == 'fastest_time' %}
<p>
This on-the-water challenge asks you to try to get
as far as you can over the
race duration. It automatically finds the fastest interval
of the given duration
in your entire workout.
</p>
{% elif race.sessiontype == 'fastest_distance' %}
<p>
This on-the-water challenge asks you to try row as hard
as you can over a set distance.
It automatically finds the fastest interval of the given length
in your entire workout.
</p>
{% else %}
<p>
Indoor challenges are open for all, wherever you live.
However, be aware of the
time zone for the challenge window.
</p>
{% endif %}
<p>
As a rowsandall.com user, you can
register to take part in this event. Please note the registration
deadline. You must register before this deadline.
You can always withdraw from participating before the registration
deadline or the start of the challenge window, whichever is earlier.
</p>
<p>
After the start of the challenge window and before the submission deadline,
you can submit results by linking the challenge to one of your uploaded
workouts. The workout start time must be within the challenge window.
{% if race.sessiontype == 'race' %}
Your course must pass through the blue polygons on the course
map (in the right order), for your result to be valid.
{% endif %}
</p>
<p>
The results table has a link to a page where details of your workout
are shown.
</p>
<p>
Challenge results are stored permanently and are not deleted when
you delete the respective workout or remove your account.
By registering, you agree with this and the challenge rules.
</p>
<p>
If you use a manually added workout for your indoor challenge result,
please attach a screenshot of the ergometer display for verification.
</p>
<p>
Virtual Racing on rowsandall.com is honors based. Please be a good
sport, submit real results rowed by you, and make sure you set the
boat type correctly. For (future functionality) age and gender
corrected times, please be sure your gender and birth date are set
correctly in your user settings.
</p>
<p>
Virtual challenges are intended as an informal way to add a
competitive element to training. Virtual challenges are not
refereed or staffed to provide for participants safety.
Individual participants are entirely responsible for their
safety while participating in a virtual challenge.
</p>
<p>
Until the evaluation closure time, the challenge organizer can
review and reject entries. If you are disqualified in this
way, you will receive an email with the reason.
</p>
{% if race.coursestandards %}
<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>
{% endif %}
</div>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_racing.html' %}
{% endblock %}