workout_wind
This commit is contained in:
@@ -1,41 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "newbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Advanced Features {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="workouts" class="grid_6 alpha">
|
||||
<div class="grid_6 alpha">
|
||||
<h1>Wind Editor</h1>
|
||||
</div>
|
||||
<div class="grid_6 alpha">
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/edit">Edit Workout</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/advanced">Advanced Edit</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="grid_2 omega tooltip">
|
||||
<p><a class="button blue small" href="/rowers/workout/{{ workout.id }}/otwsetpower">OTW Power</a></p>
|
||||
<span class="tooltiptext">Run calculations to get power values for your row.</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_6 alpha">
|
||||
<div class="grid_2 prefix_2 alpha">
|
||||
<p><a class="button gray small" href="/rowers/workout/{{ workout.id }}/workflow">Workflow View</a></p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p><a class="button blue small" href="/rowers/workout/{{ workout.id }}/stream">Stream Edit</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_6 alpha">
|
||||
{% block main %}
|
||||
<h1>Wind Editor</h1>
|
||||
<ul class="main-content">
|
||||
<li class="grid_4">
|
||||
<p>
|
||||
Update wind between distance 1 and distance 2. Submit wind strength
|
||||
and direction at start and end of segment. Blank the form for values
|
||||
@@ -47,84 +19,61 @@
|
||||
to find historical weather data from an on-line weather station near
|
||||
the location of your row.
|
||||
</p>
|
||||
|
||||
<div class="grid_4 alpha">
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p>Closest Airport Weather: {{ airport }}
|
||||
({{ airportdistance | floatformat:-1 }} km)
|
||||
<a class="button green small" href="/rowers/workout/{{ workout.id }}/metar/{{ airport }}">Airport Data</a></p>
|
||||
<p>
|
||||
<a class="button green small" href="/rowers/workout/{{ workout.id }}/darkskywind">Dark Sky Data</a>
|
||||
<p>
|
||||
Download wind speed and bearing from <a href="http://forecast.io/">The Dark Sky</a>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<input class="button green small" type="submit" value="Submit Form">
|
||||
<p>
|
||||
Manual update of the wind data from the form.
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<p>Closest Airport Weather: {{ airport }}
|
||||
({{ airportdistance | floatformat:-1 }} km)
|
||||
<a class="button green small" href="/rowers/workout/{{ workout.id }}/metar/{{ airport }}">Airport Data</a></p>
|
||||
<p>
|
||||
<a class="button green small" href="/rowers/workout/{{ workout.id }}/darkskywind">Dark Sky Data</a>
|
||||
<p>
|
||||
Download wind speed and bearing from <a href="http://forecast.io/">The Dark Sky</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<img src="http://cliparts.co/cliparts/rTn/KaR/rTnKaRrxc.gif" width="400">
|
||||
</div>
|
||||
</div>
|
||||
<div id="advancedplots" class="grid_6 omega">
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
|
||||
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
|
||||
{{ interactiveplot |safe }}
|
||||
{{ interactiveplot |safe }}
|
||||
|
||||
|
||||
<script>
|
||||
// Set things up to resize the plot on a window resize. You can play with
|
||||
// the arguments of resize_width_height() to change the plot's behavior.
|
||||
var plot_resize_setup = function () {
|
||||
var plotid = Object.keys(Bokeh.index)[0]; // assume we have just one plot
|
||||
var plot = Bokeh.index[plotid];
|
||||
var plotresizer = function() {
|
||||
// arguments: use width, use height, maintain aspect ratio
|
||||
plot.resize_width_height(true, true, true);
|
||||
};
|
||||
window.addEventListener('resize', plotresizer);
|
||||
plotresizer();
|
||||
};
|
||||
window.addEventListener('load', plot_resize_setup);
|
||||
</script>
|
||||
<style>
|
||||
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
|
||||
html, body {height: 100%; margin:5px;}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="interactiveplot" class="grid_6 omega">
|
||||
<div class="grid_6 alpha">
|
||||
{{ the_div |safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="interactiveplot" class="grid_6 omega">
|
||||
<div class="grid_6 alpha">
|
||||
{{ the_div |safe }}
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<div class="mapdiv">
|
||||
|
||||
{{ gmapdiv |safe }}
|
||||
{{ gmap |safe }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_workout.html' %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -6947,6 +6947,22 @@ def workout_downloadmetar_view(request,id=0,
|
||||
@user_passes_test(ispromember,login_url="/",redirect_field_name=None)
|
||||
def workout_wind_view(request,id=0,message="",successmessage=""):
|
||||
row = get_workout(id)
|
||||
r = getrower(request.user)
|
||||
breadcrumbs = [
|
||||
{
|
||||
'url':'/rowers/list-workouts',
|
||||
'name':'Workouts'
|
||||
},
|
||||
{
|
||||
'url':get_workout_default_page(request,id),
|
||||
'name': str(row.id)
|
||||
},
|
||||
{
|
||||
'url':reverse(workout_wind_view,kwargs={'id':id}),
|
||||
'name': 'Wind'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
if (checkworkoutuser(request.user,row)==False):
|
||||
message = "You are not allowed to edit this workout"
|
||||
@@ -7050,6 +7066,9 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
|
||||
return render(request,
|
||||
'windedit.html',
|
||||
{'workout':row,
|
||||
'rower':r,
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'active':'nav-active',
|
||||
'teams':get_my_teams(request.user),
|
||||
'interactiveplot':script,
|
||||
'form':form,
|
||||
|
||||
Reference in New Issue
Block a user