diff --git a/rowers/forms.py b/rowers/forms.py
index 310ef7d5..d7210ac4 100644
--- a/rowers/forms.py
+++ b/rowers/forms.py
@@ -6,6 +6,8 @@ from django.contrib.auth.models import User
from django.contrib.admin.widgets import AdminDateWidget
from django.forms.extras.widgets import SelectDateWidget
from django.utils import timezone,translation
+from django.forms import ModelForm
+import dataprep
import datetime
@@ -261,7 +263,7 @@ from rowers.interactiveplots import axlabels
formaxlabels = axlabels.copy()
formaxlabels.pop('None')
-parchoices = list(sorted(axlabels.items(), key = lambda x:x[1]))
+parchoices = list(sorted(formaxlabels.items(), key = lambda x:x[1]))
class ChartParamChoiceForm(forms.Form):
@@ -275,9 +277,13 @@ class ChartParamChoiceForm(forms.Form):
teamid = forms.IntegerField(widget=forms.HiddenInput())
formaxlabels.pop('time')
-metricchoices = list(sorted(axlabels.items(), key = lambda x:x[1]))
+metricchoices = list(sorted(formaxlabels.items(), key = lambda x:x[1]))
-class FusionMetricChoiceForm(forms.Form):
+class FusionMetricChoiceForm(ModelForm):
+ class Meta:
+ model = Workout
+ fields = []
+
posneg = (
('pos','Workout 2 starts after Workout 1'),
('neg','Workout 2 starts before Workout 1'),
@@ -287,3 +293,17 @@ class FusionMetricChoiceForm(forms.Form):
widget=forms.CheckboxSelectMultiple())
posneg = forms.ChoiceField(choices=posneg,initial='pos')
offset = forms.DurationField(label='Time Offset',initial=datetime.timedelta())
+
+ def __init__(self, *args, **kwargs):
+ super(FusionMetricChoiceForm, self).__init__(*args, **kwargs)
+ # need to add code to remove "empty" fields
+
+ id = self.instance.id
+ df = dataprep.getrowdata_db(id=id)
+
+ labeldict = {key:value for key,value in metricchoices}
+
+ for label in labeldict:
+ if df[label].std() == 0:
+ self.fields['columns'].choices.remove((label, labeldict[label]))
+
diff --git a/rowers/templates/advancededit.html b/rowers/templates/advancededit.html
index fe002787..6db5b03c 100644
--- a/rowers/templates/advancededit.html
+++ b/rowers/templates/advancededit.html
@@ -121,7 +121,7 @@
-
+
{% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %}
Power Histogram
@@ -133,9 +133,20 @@
Plot the Power Histogram of this workout
- Adding sensor data from workout {{ workout2.id }} into workout {{ workout1.id2 }}.
+ Adding sensor data from workout {{ workout2.id }} into workout {{ workout1.id }}.
This will create a new workout. After you submit the form, you will be
taken to the newly created workout. If you are happy with the result, you
can delete the two original workouts manually.
diff --git a/rowers/templates/fusion_list.html b/rowers/templates/fusion_list.html
new file mode 100644
index 00000000..b7f285d7
--- /dev/null
+++ b/rowers/templates/fusion_list.html
@@ -0,0 +1,121 @@
+{% extends "base.html" %}
+{% load staticfiles %}
+{% load rowerfilters %}
+
+{% block title %}Workouts{% endblock %}
+
+{% block content %}
+