Private
Public Access
1
0

Merge branch 'feature/dropdowns' into develop

This commit is contained in:
Sander Roosendaal
2018-04-09 15:36:05 +02:00
3 changed files with 37 additions and 12 deletions
+9
View File
@@ -27,6 +27,15 @@ nometrics = [
'totalangle',
'hr_bottom',
'x_right',
'Position',
'Extensions',
'GPS Speed',
'Split (IMP)',
'Speed (IMP)',
'driveenergy',
'Distance/Stroke (IMP)',
'Distance/Stroke (GPS)',
'Distance (IMP)',
'equivergpower',
'cum_dist.1'
]
+23 -11
View File
@@ -52,10 +52,11 @@
<div id="plotbuttons" class="grid_12 alpha">
<div id="x-axis" class="grid_6 alpha">
<div class="grid_2 alpha dropdown">
<div id="x-axis" class="grid_9 alpha">
<div class="grid_3 alpha dropdown">
<button class="grid_2 alpha button blue small dropbtn">X-axis</button>
<div class="dropdown-content">
<div style="float: left; width:67%;">
{% for key, value in axchoicesbasic.items %}
{% if key != 'None' %}
<a class="button blue small alpha" href="/rowers/workout/{{ id }}/flexchart/{{ key }}/{{ yparam1 }}/{{ yparam2 }}/{{ plottype }}">{{ value }}</a>
@@ -70,6 +71,8 @@
<a class="button rosy small" href="/rowers/promembership">{{ value }}</a>
{% endfor %}
{% endif %}
</div>
<div style="float: right; width: 33%;">
{% if promember %}
{% for key, value in extrametrics.items %}
<a class="button orange small" href="/rowers/workout/{{ id }}/flexchart/{{ key }}/{{ yparam1 }}/{{ yparam2 }}/{{ plottype }}">{{ value }}</a>
@@ -79,12 +82,14 @@
<a class="button rosy small" href="/rowers/promembership">{{ value }} (Pro)</a>
{% endfor %}
{% endif %}
</div>
</div>
</div>
<div id="left-y" class="grid_2 dropdown">
<div id="left-y" class="grid_3 dropdown">
<button class="grid_2 alpha button blue small dropbtn">Left</button>
<div class="dropdown-content">
<div style="float: left; width:67%;">
{% for key, value in axchoicesbasic.items %}
{% if key not in noylist and key != 'None' %}
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ key }}/{{ yparam2 }}/{{ plottype }}">{{ value }}</a>
@@ -103,6 +108,8 @@
{% endif %}
{% endfor %}
{% endif %}
</div>
<div style="float: right; width:33%;">
{% if promember %}
{% for key, value in extrametrics.items %}
<a class="button orange small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ key }}/{{ yparam2 }}/{{ plottype }}">{{ value }}</a>
@@ -112,12 +119,14 @@
<a class="button rosy small" href="/rowers/promembership">{{ value }} (Pro)</a>
{% endfor %}
{% endif %}
</div>
</div>
</div>
<div id="right-y" class="grid_2 dropdown omega">
<div id="right-y" class="grid_3 dropdown omega">
<button class="grid_2 alpha button blue small dropbtn">Right</button>
<div class="dropdown-content">
<div style="float: left; width:67%;">
{% for key, value in axchoicesbasic.items %}
{% if key not in noylist %}
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ key }}/{{ plottype }}">{{ value }}</a>
@@ -136,6 +145,8 @@
{% endif %}
{% endfor %}
{% endif %}
</div>
<div style="float: right; width:33%;">
{% if promember %}
{% for key, value in extrametrics.items %}
<a class="button orange small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ key }}/{{ plottype }}">{{ value }}</a>
@@ -145,13 +156,13 @@
<a class="button rosy small" href="/rowers/promembership">{{ value }} (Pro)</a>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
<div id="y-axis" class="grid_6 omega">
<div id="y-axis" class="grid_3 omega">
<div class="grid_2 alpha tooltip">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% csrf_token %}
@@ -165,11 +176,12 @@
</form>
<span class="tooltiptext">If your data source allows, this will show or hide strokes taken during rest intervals.</span>
</div>
<div class="grid_2">
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ yparam2 }}/line">Line Plot</a>
</div>
<div class="grid_2 omega">
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ yparam2 }}/scatter">Scatter Plot</a>
<div class="grid_1 omega">
{% if plottype == 'scatter' %}
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ yparam2 }}/line">Line</a>
{% else %}
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart/{{ xparam }}/{{ yparam1 }}/{{ yparam2 }}/scatter">Scatter</a>
{% endif %}
</div>
</div>
+5 -1
View File
@@ -7336,9 +7336,11 @@ def instroke_view(request,id=0):
return HttpResponseRedirect(url)
from metrics import nometrics
rowdata = rrdata(csvfile=row.csvfilename)
try:
instrokemetrics = rowdata.get_instroke_columns()
instrokemetrics = [m for m in instrokemetrics if not m in nometrics]
except AttributeError:
instrokemetrics = []
@@ -7427,6 +7429,7 @@ def instroke_chart(request,id=0,metric=''):
rowdata = rrdata(csvfile=w.csvfilename)
instrokemetrics = rowdata.get_instroke_columns()
if metric in instrokemetrics:
f1 = w.csvfilename[6:-4]
timestr = strftime("%Y%m%d-%H%M%S")
@@ -8456,6 +8459,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
if d['mode'] == 'water':
axchoicespro.pop(name)
from rowers.metrics import nometrics
rowdata = rdata(row.csvfilename)
try:
@@ -8464,6 +8468,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
pass
try:
additionalmetrics = rowdata.get_additional_metrics()
additionalmetrics = [m for m in additionalmetrics if not m in nometrics]
except AttributeError:
additionalmetrics = []
@@ -8474,7 +8479,6 @@ def workout_flexchart3_view(request,*args,**kwargs):
yparam1 = yparam1.replace('/','_slsh_')
yparam2 = yparam2.replace('/','_slsh_')
from rowers.metrics import nometrics
for metric in nometrics:
try: