courses functionality
This commit is contained in:
54
rowers/templates/course_edit_view.html
Normal file
54
rowers/templates/course_edit_view.html
Normal file
@@ -0,0 +1,54 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
{% block scripts %}
|
||||
{% include "monitorjobs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ course.name }} {% endblock %}
|
||||
{% block og_title %}{{ course.name }} {% endblock %}
|
||||
{% block content %}
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_2 alpha">
|
||||
{% if nosessions %}
|
||||
<a class="button small red" href="/rowers/courses/{{ course.id }}/delete">Delete</a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
{% if course.manager == rower %}
|
||||
<a class="button small gray" href="/rowers/courses/{{ course.id }}">View Course</a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
|
||||
<h1>{{ course.name }}</h1>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<form id="course_form" method="post">
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<div id="formbutton" class="grid_1 prefix_4 suffix_1 alpha">
|
||||
<input class="button green" type="submit" value="Submit">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid_6 omega">
|
||||
{{ mapdiv|safe }}
|
||||
|
||||
|
||||
{{ mapscript|safe }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
||||
@@ -9,21 +9,47 @@
|
||||
{% block og_title %}{{ course.name }} {% endblock %}
|
||||
{% block content %}
|
||||
<div class="grid_12 alpha">
|
||||
{% if nosessions %}
|
||||
<div class="grid_2 alpha">
|
||||
{% if nosessions %}
|
||||
<a class="button small red" href="/rowers/courses/{{ course.id }}/delete">Delete</a>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
{% if course.manager == rower %}
|
||||
<a class="button small gray" href="/rowers/courses/{{ course.id }}/edit">Edit</a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
|
||||
<h1>{{ course.name }}</h1>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<table class="listtable shortpadded" width="100%">
|
||||
<tr>
|
||||
<th>Name</th><td>{{ course.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Country</th><td>{{ course.country }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th><td>{{ course.notes }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="grid_6 omega">
|
||||
{{ mapdiv|safe }}
|
||||
|
||||
|
||||
{{ mapscript|safe }}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<div class="grid_12">
|
||||
|
||||
<div id="courses_table" class="grid_8 alpha">
|
||||
<h3>Courses</h3>
|
||||
|
||||
<h1>Courses</h1>
|
||||
|
||||
{% if courses %}
|
||||
<table width="100%" class="listtable shortpadded">
|
||||
<thead>
|
||||
@@ -29,27 +29,52 @@
|
||||
<th> Country</th>
|
||||
<th> Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for course in courses %}
|
||||
<td> {{ course.country }} </td>
|
||||
<td>
|
||||
{% if course.manager.user == user %}
|
||||
<a href="/rowers/courses/{{ course.id }}/edit">{{ course.name }}</a>
|
||||
{% else %}
|
||||
<a href="/rowers/courses/{{ course.id }}">{{ course.name }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<tr>
|
||||
<td> {{ course.country }} </td>
|
||||
<td>
|
||||
{% if course.manager.user == user %}
|
||||
<a href="/rowers/courses/{{ course.id }}/edit">{{ course.name }}</a>
|
||||
{% else %}
|
||||
<a href="/rowers/courses/{{ course.id }}">{{ course.name }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p> No courses found </p>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="grid_2 prefix_1 alpha">
|
||||
<a class="button small green" href="/rowers/courses/upload">Add Courses</a>
|
||||
</div>
|
||||
<p> </p>
|
||||
<form id="searchform" action="/rowers/list-courses/"
|
||||
method="get" accept-charset="utf-8">
|
||||
<div class="grid_3 prefix_1 alpha">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
</div>
|
||||
<div class="grid_1 omega">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="grid_4 omega">
|
||||
@@ -68,40 +93,52 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_4" id="about">
|
||||
<h3>About</h3>
|
||||
<p>This site is a beta site, pioneering rowing data visualization and analysis. No warranties. The site's author is
|
||||
Sander Roosendaal. A Masters rower.
|
||||
|
||||
Read his <a href="http://blog.rowsandall.com/">blog</a>
|
||||
<h2>How-to</h2>
|
||||
<p>
|
||||
Courses allow you to mark the start & finish lines of your
|
||||
test pieces and measure the time spent on the course (as opposed
|
||||
to the total duration of a workout). This allows you to row and rank
|
||||
marked courses.
|
||||
|
||||
To create a course, you use <a href="earth.google.com">Google Earth</a>
|
||||
to mark the start and finish lines using polygons. The process is identical
|
||||
to creating custom courses for the
|
||||
<a href="http://performancephones.com/crewnerd/">CrewNerd</a>
|
||||
app.
|
||||
|
||||
</p>
|
||||
<div style="text-align: right; padding: 2em">
|
||||
<a href="http://blog.rowsandall.com/">
|
||||
<img src="/static/img/sander.jpg" width="80"></a>
|
||||
</div>
|
||||
|
||||
<p>CrewNerd has published a nice video tutorial of the process.
|
||||
<a href="https://youtu.be/whhWFmMJbhM">Click here</a> to see the video. The part
|
||||
we're interested in starts at 2:05.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In addition to start and finish areas, on rowsandall.com you can add additional
|
||||
polygons to mark areas that you must pass (in that order). This allows for
|
||||
courses with turns around buoys, respecting buoy lines, or respecting traffic
|
||||
patterns on rivers and lakes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>Open Google Earth</li>
|
||||
<li>Create Start polygon</li>
|
||||
<li>Optional: Create First "must row through" polygon</li>
|
||||
<li>Optional: Create subsequent "must row through" polygons</li>
|
||||
<li>Create Finish polygon</li>
|
||||
<li>Save Place as KML file</li>
|
||||
<li>Upload the file to rowsandall.com using the "Add Courses" button</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>You are allowed to have multiple courses in one KML file.
|
||||
Your CrewNerd "courses.kml" file works out of the box</p>
|
||||
|
||||
<p>The site doesn't test for duplicate courses.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="grid_2 prefix_1 alpha">
|
||||
<a class="button small green" href="/rowers/courses/upload">Add Course</a>
|
||||
</div>
|
||||
<p> </p>
|
||||
<form id="searchform" action="/rowers/list-courses/"
|
||||
method="get" accept-charset="utf-8">
|
||||
<div class="grid_3 prefix_1 alpha">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
</div>
|
||||
<div class="grid_1 omega">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -57,7 +57,11 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
<div class="grid_2 omega">
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_12 alpha">
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="grid_2 omega">
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div id="right" class="grid_6 alpha">
|
||||
|
||||
@@ -56,7 +56,9 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="grid_2 omega">
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
{% if plannedsessions %}
|
||||
<p>
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
{% if plannedsession.sessiontype == 'coursetest' %}
|
||||
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div id="left" class="grid_6 alpha">
|
||||
@@ -128,6 +135,16 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div id="left" class="grid_6 alpha">
|
||||
{% if coursescript %}
|
||||
<h1>Course</h1>
|
||||
{{ coursediv|safe }}
|
||||
|
||||
{{ coursescript|safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user