Uploading files
This commit is contained in:
142
rowers/templates/workout_view.html
Normal file
142
rowers/templates/workout_view.html
Normal file
@@ -0,0 +1,142 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}View Workout {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="workouts" class="grid_6 alpha">
|
||||
|
||||
|
||||
<h1>Workout Data</h1>
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<th>Rower:</th><td>{{ first_name }} {{ last_name }}</td>
|
||||
</tr><tr>
|
||||
<tr>
|
||||
<th>Name:</th><td>{{ workout.name }}</td>
|
||||
</tr><tr>
|
||||
<tr>
|
||||
<th>Date:</th><td>{{ workout.date }}</td>
|
||||
</tr><tr>
|
||||
<th>Time:</th><td>{{ workout.starttime }}</td>
|
||||
</tr><tr>
|
||||
<th>Distance:</th><td>{{ workout.distance }}m</td>
|
||||
</tr><tr>
|
||||
<th>Duration:</th><td>{{ workout.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||
</tr><tr>
|
||||
<th>Type:</th><td>{{ workout.workouttype }}</td>
|
||||
</tr><tr>
|
||||
<th>Weight Category:</th><td>{{ workout.weightcategory }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1>Workout Summary</h1>
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
{{ workout.summary }}
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div id="images" class="grid_6 omega">
|
||||
|
||||
<h1>Images linked to this workout</h1>
|
||||
{% if graphs1 %}
|
||||
|
||||
{% for graph in graphs1 %}
|
||||
{% if forloop.counter == 1 %}
|
||||
<div id="thumb-container" class="grid_2 alpha">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
{% elif forloop.counter == 3 %}
|
||||
<div id="thumb-container" class="grid_2 omega">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div id="thumb-container" class="grid_2">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% for graph in graphs2 %}
|
||||
{% if forloop.counter == 1 %}
|
||||
<div id="thumb-container" class="grid_2 alpha">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
{% elif forloop.counter == 3 %}
|
||||
<div id="thumb-container" class="grid_2 omega">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div id="thumb-container" class="grid_2">
|
||||
<a href="/rowers/graph/{{ graph.id }}/">
|
||||
<img src="/{{ graph.filename }}"
|
||||
onerror="this.src='/static/img/waiting.png'"
|
||||
alt="{{ graph.filename }}" width="120" height="100"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% else %}
|
||||
<p> No graphs found </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<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">
|
||||
{{ the_div|safe }}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user