diff --git a/rowers/forms.py b/rowers/forms.py index 8599496b..ffef4328 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -746,7 +746,8 @@ class PlanSelectForm(forms.Form): self.fields['plan'].empty_label = None if paymentprocessor: self.fields['plan'].queryset = PaidPlan.objects.filter( - paymentprocessor=paymentprocessor + paymentprocessor=paymentprocessor, + active=True ).exclude( shortname="basic" ).order_by( @@ -758,7 +759,8 @@ class PlanSelectForm(forms.Form): except AttributeError: amount = 0 self.fields['plan'].queryset = PaidPlan.objects.filter( - paymentprocessor=rower.paymentprocessor + paymentprocessor=rower.paymentprocessor, + active=True ).exclude( price__lte=amount ).order_by( diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index d1b88a42..1c21937d 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -248,7 +248,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'): rowersinitials = {} seen = ['seen'] idseen = [] - + for w in workouts: aantal=1 initials = w.user.user.first_name[0:aantal]+w.user.user.last_name[0:aantal] @@ -673,6 +673,9 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower'): dates = [m.date for m in fitnessmetrics] mode = [m.workoutmode for m in fitnessmetrics] + if len(power4min) == 0: + return ['',''] + df = pd.DataFrame( {'power4min':power4min, 'power2k':power2k, @@ -808,7 +811,6 @@ def interactive_histoall(theworkouts): rowdata = dataprep.getsmallrowdata_db(['power'],ids=ids,doclean=True) - rowdata.dropna(axis=0,how='any',inplace=True) if rowdata.empty: @@ -1270,45 +1272,6 @@ def leaflet_chart2(lat,lon,name=""): return script,div - -def googlemap_chart(lat,lon,name=""): - if lat.empty or lon.empty: - return [0,"invalid coordinate data"] - # plot tools - TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize' - - map_options = GMapOptions(lat = lat.mean(),lng=lon.mean(), - map_type="roadmap",zoom=13) - - plot = GMapPlot( - x_range=DataRange1d(), y_range=DataRange1d(), - map_options=map_options, - api_key = "AIzaSyAgu1w9QSthaGPMLp8y9JedPoMc9sfEgJ8", - plot_width=400,plot_height=400, - toolbar_sticky=False, - - ) - - - source = ColumnDataSource( - data = dict( - lat=lat, - lon=lon, - ) - ) - - circle = Circle(x="lon",y="lat",size=5,fill_color="blue", - fill_alpha=0.2,line_color=None) - plot.add_glyph(source,circle) - plot.add_tools(PanTool(), WheelZoomTool(), - SaveTool(), ResizeTool(), ResetTool(), - TapTool(),CrosshairTool(), - ) - plot.title.text = name - plot.title.text_font="1.0em" - script, div = components(plot) - - return [script,div] def interactive_agegroupcpchart(age,normalized=False): durations = [1,4,30,60] diff --git a/rowers/models.py b/rowers/models.py index ab8f822f..29322052 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -568,6 +568,8 @@ class PaidPlan(models.Model): choices=paymenttypes, ) + active = models.BooleanField(default=True) + clubsize = models.IntegerField(default=0) def __unicode__(self): diff --git a/rowers/payments.py b/rowers/payments.py index 503d6f4b..1e4304fa 100644 --- a/rowers/payments.py +++ b/rowers/payments.py @@ -10,27 +10,30 @@ def planstopaypal(): plan.external_id = None plan.save() -def initiaterowerplans(): - rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None) - for r in rowers: - r.paymentprocessor = 'paypal' - r.save() +#def initiaterowerplans(): +# rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None) +# for r in rowers: +# r.paymentprocessor = 'paypal' +# r.save() -def setrowerplans(): - rowers = Rower.objects.all() +#def setrowerplans(): +# rowers = Rower.objects.all() - for r in rowers: - paidplans = PaidPlan.objects.filter( - shortname = r.rowerplan, - paymenttype = r.paymenttype, - clubsize = r.clubsize, - paymentprocessor=r.paymentprocessor) +# for r in rowers: +# paidplans = PaidPlan.objects.filter( +# shortname = r.rowerplan, +# paymenttype = r.paymenttype, +# clubsize = r.clubsize, +# paymentprocessor=r.paymentprocessor) - if paidplans: - r.paidplan = paidplans[0] - r.save() - else: - print 'Could not set plan for ',r +# if paidplans: +# r.paidplan = paidplans[0] +# r.save() +# else: +# try: +# print 'Could not set plan for ',r.user.username +# except: +# pass def is_existing_customer(rower): if rower.country is not None and rower.customer_id is not None and rower.country != '': diff --git a/rowers/templates/about_us.html b/rowers/templates/about_us.html index 1d64d9b4..c178aa32 100644 --- a/rowers/templates/about_us.html +++ b/rowers/templates/about_us.html @@ -93,7 +93,7 @@ and inspired by the RowPro Dan Burpee spreadsheet
We offer three plans. Click on the name of the plan to find out more:
Functionality marked with an asterisk (*) is limited to the paid plans. See - the page about Pro membership + the page about Pro membership for more information and to sign up for Pro Membership
{% endif %} @@ -62,7 +62,7 @@ {% if user|is_promember %} Compare Workouts {% else %} - Compare Workouts* + Compare Workouts* {% endif %}Compare this workout to other workouts. Plot HR, SPM, or pace vs time or distance for the two workouts. @@ -82,7 +82,7 @@ {% if user|is_promember %} Edit Intervals {% else %} - Edit Intervals* + Edit Intervals* {% endif %}
Enter or change the interval and summary data for your workout @@ -98,7 +98,7 @@ {% if user|is_promember %} Dist Metrics Plot {% else %} - Dist Metrics Plot* + Dist Metrics Plot* {% endif %}@@ -110,7 +110,7 @@ {% if user|is_promember %} Time Metrics Plot {% else %} - Time Metrics Plot* + Time Metrics Plot* {% endif %}
@@ -122,7 +122,7 @@ {% if user|is_promember %} Power Histogram {% else %} - Power Histogram* + Power Histogram* {% endif %}
@@ -136,7 +136,7 @@ {% if user|is_promember %} Glue {% else %} - Glue* + Glue* {% endif %}
@@ -149,7 +149,7 @@ {% if user|is_promember %} Sensor Fusion {% else %} - Sensor Fusion* + Sensor Fusion* {% endif %}
@@ -161,7 +161,7 @@ {% if user|is_promember %} Split Workout {% else %} - Split Workout* + Split Workout* {% endif %}
diff --git a/rowers/templates/advancedotw.html b/rowers/templates/advancedotw.html index 4e8c0924..56d5a322 100644 --- a/rowers/templates/advancedotw.html +++ b/rowers/templates/advancedotw.html @@ -16,7 +16,7 @@
Functionality marked with an asterisk (*) is limited to the paid plans. See - the page about Pro membership + the page about Pro membership for more information and to sign up for Pro Membership
{% endif %}@@ -82,7 +82,7 @@ {% if user|is_promember %} Edit Intervals {% else %} - Edit Intervals* + Edit Intervals* {% endif %}
Enter or change the interval and summary data for your workout @@ -99,7 +99,7 @@ {% if user|is_promember %} CrewNerd Summary {% else %} - CrewNerd Summary* + CrewNerd Summary* {% endif %} @@ -113,7 +113,7 @@ {% if user|is_promember %} Stroke Profile (Empower) {% else %} - Stroke Profile (Empower)* + Stroke Profile (Empower)* {% endif %} Analyze your stroke force profile (need Empower Oarlock data)@@ -126,7 +126,7 @@ {% if user|is_promember %} OTW Power Plot {% else %} - OTW Power Plot* + OTW Power Plot* {% endif %}
Note: You must run the OTW calculations under Geeky Stuff first. Otherwise the plot will be empty @@ -146,7 +146,7 @@ {% if user|is_promember %} Geeky Stuff {% else %} - Geeky Stuff* + Geeky Stuff* {% endif %} @@ -161,7 +161,7 @@ {% if user|is_promember %} Smooth out Pace Data {% else %} - Smooth out Pace Data* + Smooth out Pace Data* {% endif %} @@ -178,7 +178,7 @@ {% if user|is_promember %} Raw Data {% else %} - Reset Smoothing* + Reset Smoothing* {% endif %}@@ -193,7 +193,7 @@ {% if user|is_promember %} Glue {% else %} - Glue* + Glue* {% endif %}
@@ -205,7 +205,7 @@ {% if user|is_promember %} Sensor Fusion {% else %} - Sensor Fusion* + Sensor Fusion* {% endif %}
@@ -217,7 +217,7 @@ {% if user|is_promember %} Split Workout {% else %} - Split Workout* + Split Workout* {% endif %}
diff --git a/rowers/templates/basebase.html b/rowers/templates/basebase.html index 41dd1dfb..98f30743 100644 --- a/rowers/templates/basebase.html +++ b/rowers/templates/basebase.html @@ -98,7 +98,7 @@ {% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %}
Unless specified otherwise, the payments on the recurring payment plans are annual. The prices are specified - as a price per year. + as a price per year. You can downgrade or cancel your + plan at any time in your settings.