diff --git a/requirements.txt b/requirements.txt index e6eda95f..d08e1fed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ braintree==3.55.0 cairocffi==1.0.2 celery==4.3.0 certifi==2019.3.9 -cffi==1.12.2 +cffi==1.14.0 chardet==3.0.4 Click==7.0 cloudpickle==1.2.2 @@ -126,7 +126,7 @@ nose==1.3.7 nose-parameterized==0.6.0 notebook==5.7.6 numba==0.46.0 -numpy==1.16.2 +numpy==1.18.3 oauth2==1.9.0.post1 oauthlib==3.0.1 openapi-codec==1.3.2 @@ -175,11 +175,11 @@ ratelim==0.1.6 redis==3.2.1 requests==2.21.0 requests-oauthlib==1.2.0 -rowingdata==2.8.3 +rowingdata==2.8.4 rowingphysics==0.5.0 rq==0.13.0 rules==2.1 -scipy==1.4.1 +scipy==1.2.1 SecretStorage==3.1.1 Send2Trash==1.5.0 shell==1.0.1 diff --git a/rowers/models.py b/rowers/models.py index d63af15c..c89fcb9d 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -697,6 +697,14 @@ class Rower(models.Model): ('Workout','Workout'), ('Yoga','Yoga'), ) + + gridtypes = ( + ('none',None), + ('both','both'), + ('x','x'), + ('y','y'), + ) + user = models.OneToOneField(User,on_delete=models.CASCADE) #billing details @@ -880,6 +888,10 @@ class Rower(models.Model): showfavoritechartnotes = models.BooleanField(default=True, verbose_name='Show Notes for Favorite Charts') + # Static chart settings + staticgrids = models.CharField(default=None,choices=gridtypes,null=True,max_length=50, + verbose_name='Chart Grid') + def __str__(self): return self.user.first_name+' '+self.user.last_name @@ -3438,7 +3450,15 @@ class AccountRowerForm(ModelForm): if 'coach' not in self.instance.rowerplan: self.fields.pop('offercoaching') +# Form to set static chart settings +class StaticChartRowerForm(ModelForm): + class Meta: + model = Rower + fields = ['staticgrids'] + def __init__(self, *args, **kwargs): + super(StaticChartRowerForm, self).__init__(*args, **kwargs) + self.fields['staticgrids'].required = False class UserForm(ModelForm): diff --git a/rowers/tasks.py b/rowers/tasks.py index bf502f43..7f3ff101 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -1902,34 +1902,34 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename, row.df = df nr_rows = len(row.df) if (plotnr == 1): - fig1 = row.get_timeplot_erg(t) + fig1 = row.get_timeplot_erg(t,**kwargs) elif (plotnr == 2): - fig1 = row.get_metersplot_erg(t) + fig1 = row.get_metersplot_erg(t,**kwargs) elif (plotnr == 3): t += ' - Heart Rate Distribution' - fig1 = row.get_piechart(t) + fig1 = row.get_piechart(t,**kwargs) elif (plotnr == 4): if haspower: - fig1 = row.get_timeplot_otwempower(t) + fig1 = row.get_timeplot_otwempower(t,**kwargs) else: - fig1 = row.get_timeplot_otw(t) + fig1 = row.get_timeplot_otw(t,**kwargs) elif (plotnr == 5): if haspower: - fig1 = row.get_metersplot_otwempower(t) + fig1 = row.get_metersplot_otwempower(t,**kwargs) else: - fig1 = row.get_metersplot_otw(t) + fig1 = row.get_metersplot_otw(t,**kwargs) elif (plotnr == 6): t += ' - Heart Rate Distribution' - fig1 = row.get_piechart(t) + fig1 = row.get_piechart(t,**kwargs) elif (plotnr == 7) or (plotnr == 10): - fig1 = row.get_metersplot_erg2(t) + fig1 = row.get_metersplot_erg2(t,**kwargs) elif (plotnr == 8) or (plotnr == 11): - fig1 = row.get_timeplot_erg2(t) + fig1 = row.get_timeplot_erg2(t,**kwargs) elif (plotnr == 9) or (plotnr == 12): - fig1 = row.get_time_otwpower(t) + fig1 = row.get_time_otwpower(t,**kwargs) elif (plotnr == 13) or (plotnr == 16): t += ' - Power Distribution' - fig1 = row.get_power_piechart(t) + fig1 = row.get_power_piechart(t,**kwargs) if fig1 is None: return 0 diff --git a/rowers/templates/favoritecharts.html b/rowers/templates/favoritecharts.html index 63fc02e5..bdb933ee 100644 --- a/rowers/templates/favoritecharts.html +++ b/rowers/templates/favoritecharts.html @@ -1,8 +1,21 @@ {% extends "newbase.html" %} -{% block title %}Change Favorite Charts{% endblock %} +{% block title %}Change Charts Settings {% endblock %} {% block main %} +
+
+ + +