stream view
This commit is contained in:
@@ -1,48 +1,20 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "newbase.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
{% block title %}Advanced Features {% endblock %}
|
{% block title %}Advanced Features {% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block main %}
|
||||||
<div id="workouts" class="grid_6 alpha">
|
<h1>Stream Editor</h1>
|
||||||
|
<ul class="main-content">
|
||||||
<div class="grid_6 alpha">
|
<li class="grid_4">
|
||||||
<h1>Stream 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 }}/wind">Wind Edit</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="grid_6 alpha">
|
|
||||||
<p>
|
<p>
|
||||||
Edit river Stream between turning points in your row.
|
Edit river Stream between turning points in your row.
|
||||||
Use positive (+) values to denote rowing with the stream,
|
Use positive (+) values to denote rowing with the stream,
|
||||||
negative (-) values to denote rowing against the stream.
|
negative (-) values to denote rowing against the stream.
|
||||||
</p>
|
</p>
|
||||||
|
</li>
|
||||||
|
<li class="grid_2">
|
||||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
<p style="color: red;">
|
<p style="color: red;">
|
||||||
@@ -54,47 +26,26 @@
|
|||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
</table>
|
</table>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
</div>
|
<input class="button green small" type="submit" value="Submit Form">
|
||||||
<div id="formbutton" class="grid_1 prefix_3 suffix_2">
|
</form>
|
||||||
<input class="button green" type="submit" value="Update">
|
<img src="/static/img/rivercurrent.jpg" width="400">
|
||||||
</div>
|
</li>
|
||||||
</form>
|
<li class="grid_2">
|
||||||
<img src="/static/img/rivercurrent.jpg" width="400">
|
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
|
||||||
|
<script async="true" type="text/javascript">
|
||||||
</div>
|
Bokeh.set_log_level("info");
|
||||||
|
|
||||||
<div id="advancedplots" class="grid_6 omega">
|
|
||||||
|
|
||||||
<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 }}
|
|
||||||
|
|
||||||
<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>
|
</script>
|
||||||
<style>
|
|
||||||
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
|
{{ interactiveplot |safe }}
|
||||||
html, body {height: 100%; margin:5px;}
|
|
||||||
</style>
|
{{ the_div |safe }}
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<div id="interactiveplot" class="grid_6 omega">
|
</ul>
|
||||||
{{ the_div |safe }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'menu_workout.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -7068,7 +7068,7 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
|
|||||||
{'workout':row,
|
{'workout':row,
|
||||||
'rower':r,
|
'rower':r,
|
||||||
'breadcrumbs':breadcrumbs,
|
'breadcrumbs':breadcrumbs,
|
||||||
'active':'nav-active',
|
'active':'nav-workouts',
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'interactiveplot':script,
|
'interactiveplot':script,
|
||||||
'form':form,
|
'form':form,
|
||||||
@@ -7083,6 +7083,7 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
|
|||||||
@user_passes_test(ispromember,login_url="/",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/",redirect_field_name=None)
|
||||||
def workout_stream_view(request,id=0,message="",successmessage=""):
|
def workout_stream_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
|
r = getrower(request.user)
|
||||||
|
|
||||||
if (checkworkoutuser(request.user,row)==False):
|
if (checkworkoutuser(request.user,row)==False):
|
||||||
message = "You are not allowed to edit this workout"
|
message = "You are not allowed to edit this workout"
|
||||||
@@ -7135,11 +7136,30 @@ def workout_stream_view(request,id=0,message="",successmessage=""):
|
|||||||
script = res[0]
|
script = res[0]
|
||||||
div = res[1]
|
div = res[1]
|
||||||
|
|
||||||
|
breadcrumbs = [
|
||||||
|
{
|
||||||
|
'url':'/rowers/list-workouts',
|
||||||
|
'name':'Workouts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':get_workout_default_page(request,id),
|
||||||
|
'name': str(row.id)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':reverse(workout_stream_view,kwargs={'id':id}),
|
||||||
|
'name': 'Stream'
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
messages.info(request,successmessage)
|
messages.info(request,successmessage)
|
||||||
messages.error(request,message)
|
messages.error(request,message)
|
||||||
return render(request,
|
return render(request,
|
||||||
'streamedit.html',
|
'streamedit.html',
|
||||||
{'workout':row,
|
{'workout':row,
|
||||||
|
'rower':r,
|
||||||
|
'breadcrumbs':breadcrumbs,
|
||||||
|
'active':'nav-workouts',
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'interactiveplot':script,
|
'interactiveplot':script,
|
||||||
'form':form,
|
'form':form,
|
||||||
@@ -9359,7 +9379,7 @@ def workout_uploadimage_view(request,id):
|
|||||||
return render(request,'image_form.html',
|
return render(request,'image_form.html',
|
||||||
{'form':form,
|
{'form':form,
|
||||||
'rower':r,
|
'rower':r,
|
||||||
'active':'nav-active',
|
'active':'nav-workouts',
|
||||||
'breadcrumbs':breadcrumbs,
|
'breadcrumbs':breadcrumbs,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'workout': w,
|
'workout': w,
|
||||||
|
|||||||
Reference in New Issue
Block a user