Private
Public Access
1
0
Files
rowsandall/rowers/templates/cumstats.html
2017-02-09 12:23:56 +01:00

140 lines
4.3 KiB
HTML

{% extends "base.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% block title %}Workout Statistics{% endblock %}
{% block content %}
<div class="grid_12 alpha">
<h1>Workout Statistics</h1>
<p>
This is an experimental page which just lists a bunch of statistics for
your workouts. This page is under rapid development.
</p>
</div>
<div class="grid_12 alpha">
<div id="summary" class="grid_6 alpha">
<p>Summary for {{ theuser.first_name }} {{ theuser.last_name }}
between {{ startdate|date }} and {{ enddate|date }}</p>
<p>Direct link for other Pro users:
<a href="/rowers/{{ id }}/cumstats/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/cumstats/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
</p>
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% csrf_token %}
<div class="grid_2 alpha">
<table>
{{ optionsform.as_table }}
</table>
</div>
<div class="grid_2 suffix_2 omega">
<input type="hidden" name="options" value="options">
<input class="grid_1 alpha button green small" value="Submit" type="Submit">
</div>
</form>
</div>
<div id="form" class="grid_6 omega">
<p>Use this form to select a different date range:</p>
<p>
Select start and end date for a date range:
<div class="grid_4 alpha">
<form enctype="multipart/form-data" action="" method="post">
<table>
{{ form.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
</div>
<div class="grid_4 alpha">
<form enctype="multipart/form-data" action="" method="post">
Or use the last {{ deltaform }} days.
</div>
<div class="grid_2 omega">
{% csrf_token %}
<input name='datedelta' class="button green" type="submit" value="Submit">
</form>
</div>
</div>
</div>
<div class="grid_12 alpha">
<div class="grid_4 alpha">
{% if stats %}
{% for key, value in stats.items %}
<h2>{{ value.verbosename }}</h2>
<table width="100%" class="listtable">
<thead>
<tr>
<th>Metric</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mean</td><td>{{ value.mean|floatformat:-2 }}</td>
</tr><tr>
<td>Minimum</td><td>{{ value.min|floatformat:-2 }}</td>
</tr><tr>
<td>25&#37;</td><td>{{ value.firstq|floatformat:-2 }}</td>
</tr><tr>
<td>Median</td><td>{{ value.median|floatformat:-2 }}</td>
</tr><tr>
<td>75&#37;</td><td>{{ value.thirdq|floatformat:-2 }}</td>
</tr><tr>
<td>Maximum</td><td>{{ value.max|floatformat:-2 }}</td>
</tr><tr>
<td>Standard Deviation</td><td>{{ value.std|floatformat:-2 }}</td>
</tr>
</tbody>
</table>
{% endfor %}
{% endif %}
</div>
<div class="grid_8 omega">
{% if cordict %}
<h2> Correlation Matrix</h2>
<p>This matrix indicates a positive (+) or negative (-) correlation between two parameters. The Spearman correlation coefficient has values between +1 and -1. Positive correlation between two metrics means that if one metric increases, the other value is also likely to increase. Negative is the opposite. The further from zero, the higher the likelyhood.
</p>
<table width="90%" class="cortable">
<thead>
<tr>
<th>&nbsp;</th>
{% for key,value in cordict.items %}
<th class="rotate"><div><span>{{ key }}</span></div></th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for key, thedict in cordict.items %}
<tr>
<th> {{ key }}</th>
{% for key2,value in thedict.items %}
<td>
{% if value > 0.5 %}
<div class="poscor">{{ value|floatformat:-1 }}</div>
{% elif value > 0.1 %}
<div class="weakposcor">{{ value|floatformat:-1 }}</div>
{% elif value < -0.5 %}
<div class="negcor">{{ value|floatformat:-1 }}</div>
{% elif value < -0.1 %}
<div class="weaknegcor">{{ value|floatformat:-1 }}</div>
{% else %}
&nbsp;
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
{% endblock %}