diff --git a/rowers/forms.py b/rowers/forms.py index 3c3cef2d..c0ee89fd 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -578,6 +578,12 @@ class RegistrationForm(UserCreationForm): model = User fields = ("username", "first_name", "last_name", "email", "password1", "password2") + widgets = { + 'username': forms.TextInput(attrs={'autocomplete':'new-password'}), + 'password1': forms.PasswordInput(attrs={'autocomplete':'new-password'}), + 'password2': forms.PasswordInput(attrs={'autocomplete':'new-password'}), + } + class RegistrationFormTermsOfService(RegistrationForm): """ Subclass of ``RegistrationForm`` which adds a required checkbox diff --git a/rowers/models.py b/rowers/models.py index 7f50af9f..37a13822 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -651,6 +651,10 @@ class CoachingGroup(models.Model): id = self.pk, name = self.name ) + + def __len__(self): + rs = Rower.objects.filter(coachinggroups__in=[self]) + return len(rs) # Extension of User with rowing specific data @python_2_unicode_compatible @@ -2486,14 +2490,16 @@ class PlannedSessionFormSmall(ModelForm): ] dateTimeOptions = { - 'format': 'yyyy-mm-dd', + 'format': '%Y-%m-%d', 'autoclose': True, } + + input_formats=('%Y-%m-%d') widgets = { - 'startdate': DateInput(attrs={'size':10}), - 'enddate': DateInput(attrs={'size':10}), - 'preferreddate': DateInput(attrs={'size':10}), + 'startdate': DateInput(attrs={'size':10, 'class':'datepicker'}, format='%Y-%m-%d'), + 'enddate': DateInput(attrs={'size':10, 'class':'datepicker'}, format='%Y-%m-%d'), + 'preferreddate': DateInput(attrs={'size':10, 'class':'datepicker'}, format='%Y-%m-%d'), 'name': forms.TextInput(attrs={'size':10}), 'sessionvalue': forms.TextInput(attrs={'style':'width:5em', 'type':'number'}), diff --git a/rowers/templates/freecoach_registration_form.html b/rowers/templates/freecoach_registration_form.html index b747e2b0..a1746819 100644 --- a/rowers/templates/freecoach_registration_form.html +++ b/rowers/templates/freecoach_registration_form.html @@ -10,7 +10,14 @@
  • New Coach Registration (free Coach Plan)

  • -
  • +
  • +

    + This form is for registration as a coach. + Click here to register as a rower. +

    +

    + Already signed up? Click here to sign in. +

    {% if form.errors %} @@ -19,14 +26,18 @@

    {% endif %} -
    + {% csrf_token %} {{ form.as_table }}
    - Terms of Service - - +

    + Terms of Service +

    +

    + + +

  • @@ -43,32 +54,6 @@

    Also, we are restricting access to the site to 16 years and older because of EU data protection regulations.

    -
  • - -

    Register as a coach (free)

    -

    Click here and fill out the form to start with a free Coach plan. This allows you - to manage up to 10 athletes (who have to be on the Pro plan). You cannot upload your own - workouts. -

    -

    - From this free plan, you can upgrade to any of the paid plans, including coach plans for larger - athlete groups or rower plans for managing your own training plan and workouts. -

    -
    -
  • -
  • - -

    Register as an athlete (free)

    -

    Click here and fill out the form to start with a free Athlete plan. This allows you - to store and analyze your own workouts. -

    -

    - From this free plan, you can upgrade to any of the paid plans, including - coach plans for managing larger athlete groups or rower plans for expanded - analytics. -

    -
    -
  • diff --git a/rowers/templates/landingpage.html b/rowers/templates/landingpage.html index d077263a..60f01d68 100644 --- a/rowers/templates/landingpage.html +++ b/rowers/templates/landingpage.html @@ -179,7 +179,7 @@ {% else %}
    - Enter  + Launch App 
    {% endif %}
    diff --git a/rowers/templates/paidplans.html b/rowers/templates/paidplans.html index 4038f032..5d27fb7c 100644 --- a/rowers/templates/paidplans.html +++ b/rowers/templates/paidplans.html @@ -27,6 +27,7 @@ PRO SELF-COACH COACH + Free COACH @@ -36,6 +37,7 @@ ✔ ✔ ✔ + ✔ Manual Import, Export, Synchronization and download of all your data @@ -43,6 +45,7 @@ ✔ ✔ ✔ + ✔ Heart rate and power zones @@ -50,6 +53,7 @@ ✔ ✔ ✔ + ✔ Ranking Pieces, Stroke Analysis @@ -57,6 +61,7 @@ ✔ ✔ ✔ + ✔ Automatic Synchronization with other fitness sites @@ -64,6 +69,7 @@ ✔ ✔ ✔ +   Advanced Analysis (Critical Power, Stats, Box Chart, Trend Flex) @@ -71,6 +77,7 @@ ✔ ✔ ✔ + ✔* Compare Workouts @@ -78,6 +85,7 @@ ✔ ✔ ✔ + ✔* Empower Stroke Profile @@ -85,6 +93,7 @@ ✔ ✔ ✔ + ✔* Sensor Fusion, Split Workout, In-stroke metrics @@ -92,6 +101,7 @@ ✔ ✔ ✔ + ✔* Create and manage groups. @@ -99,6 +109,7 @@ ✔ ✔ ✔ + ✔ Create Training plans, tests and challenges for yourself and your training group. Track your performance @@ -107,6 +118,7 @@   ✔ ✔ +   Create Training plans, tests and challenges for your athletes. Track their performance @@ -115,6 +127,7 @@     ✔ + ✔ Manage your athlete's workouts @@ -122,6 +135,7 @@     ✔ + ✔ Run analytics for your athletes @@ -129,6 +143,7 @@     ✔ + ✔* Change zone intensities and other workout related settings for your athletes @@ -136,6 +151,7 @@     ✔ + ✔ Pricing @@ -143,6 +159,7 @@ From 25€/year From 75€/year From 90€/year + Free   @@ -310,10 +327,12 @@ can purchase upgrades to "Pro" and "Self-Coach" plans.

    -

    +

    The Coach plans come in two versions: free and paid. On the free coach plan, you can only have athletes who are on the PRO paid plans or higher, and you - cannot upload any workouts to your own account. On the paid + cannot upload any workouts to your own account. Some of the advanced Analysis functionality + becomes available when the athlete group is larger than 4. + On the paid plans, your athletes can be on the free plan, and you have full access to the site functionality for your own workouts and those of your athletes.

    diff --git a/rowers/templates/registration_form.html b/rowers/templates/registration_form.html index ef098e65..d7c27f4c 100644 --- a/rowers/templates/registration_form.html +++ b/rowers/templates/registration_form.html @@ -8,9 +8,16 @@ {% block main %}
    • -

      New User Registration

      +

      New Rower Registration

    • -
    • +
    • +

      + This form is for registration as a rower. + Click here to register as a coach. +

      +

      + Already signed up? Click here to sign in. +

      {% if form.errors %} @@ -19,14 +26,18 @@

      {% endif %} -
      + {% csrf_token %} {{ form.as_table }}
      - Terms of Service - - +

      + Terms of Service +

      +

      + + +

    • @@ -43,32 +54,6 @@

      Also, we are restricting access to the site to 16 years and older because of EU data protection regulations.

      -
    • - -

      Register as a coach (free)

      -

      Click here and fill out the form to start with a free Coach plan. This allows you - to manage up to 10 athletes (who have to be on the Pro plan). You cannot upload your own - workouts. -

      -

      - From this free plan, you can upgrade to any of the paid plans, including coach plans for larger - athlete groups or rower plans for managing your own training plan and workouts. -

      -
      -
    • -
    • - -

      Register as an athlete (free)

      -

      Click here and fill out the form to start with a free Athlete plan. This allows you - to store and analyze your own workouts. -

      -

      - From this free plan, you can upgrade to any of the paid plans, including - coach plans for managing larger athlete groups or rower plans for expanded - analytics. -

      -
      -
    diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index 728ae80a..eb6a3b61 100644 Binary files a/rowers/tests/testdata/testdata.csv.gz and b/rowers/tests/testdata/testdata.csv.gz differ diff --git a/rowers/utils.py b/rowers/utils.py index f0a1d4b9..d4e47993 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -20,6 +20,7 @@ import requests from django.http import HttpResponse + lbstoN = 4.44822 landingpages = ( @@ -407,8 +408,12 @@ def totaltime_sec_to_string(totaltime): def isprorower(r): result = False result = r.rowerplan in ['pro','coach','plan'] + if not result and r.protrialexpires: result = r.rowerplan == 'basic' and r.protrialexpires >= datetime.date.today() + if not result and r.rowerplan == 'freecoach': + if r.mycoachgroup is not None: + result = len(r.mycoachgroup)>=4 return result diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py index 543cc95b..c46f5327 100644 --- a/rowers/views/analysisviews.py +++ b/rowers/views/analysisviews.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals from __future__ import unicode_literals, absolute_import from rowers.views.statements import * +import collections from jinja2 import Template,Environment,FileSystemLoader def floatformat(x,prec=2): @@ -2796,12 +2797,12 @@ def oterankings_view(request,theuser=0, except: pwr2 = pwr - a = { - 'distance':int(d), - 'duration':timedeltaconv(t), - 'power':int(pwr), - 'upper':int(pwr2), - 'pace':timedeltaconv(p)} + a = collections.OrderedDict() + a['duration'] = timedeltaconv(t) + a['distance'] = int(d) + a['pace'] = timedeltaconv(p) + a['power'] = int(pwr) + a['upper'] = int(pwr2) cpredictions.append(a) diff --git a/rowers/views/otherviews.py b/rowers/views/otherviews.py index 2a1f0be2..b2e74531 100644 --- a/rowers/views/otherviews.py +++ b/rowers/views/otherviews.py @@ -96,7 +96,7 @@ def remove_user(request): success, themessages,errormessages = braintreestuff.cancel_subscription(r,id) for message in themessages: messages.info(request,message) - except ProcessorCustomerError: + except: pass if cd['delete_user']: diff --git a/rowers/views/statements.py b/rowers/views/statements.py index 045ef2ea..8b9a9991 100644 --- a/rowers/views/statements.py +++ b/rowers/views/statements.py @@ -1049,7 +1049,8 @@ def hasplannedsessions(user): return result -from rowers.utils import isprorower,ProcessorCustomerError +from rowers.utils import ProcessorCustomerError +from rowers.utils import isprorower # Check if a user is a Pro member def ispromember(user): diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 83046177..92c7e7ee 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -3563,8 +3563,8 @@ def workout_edit_view(request,id=0,message="",successmessage=""): else: indoorraces = [] - r = getrower(request.user) - + + r = row.user # render page return render(request, 'workout_form.html', {'form':form, diff --git a/rowsandall_app/urls.py b/rowsandall_app/urls.py index 6948704e..ed10f7d5 100644 --- a/rowsandall_app/urls.py +++ b/rowsandall_app/urls.py @@ -53,7 +53,7 @@ urlpatterns += [ content_type='text/plain')), re_path(r'^admin/', admin.site.urls), re_path(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework2')), - re_path(r'^$',rootview), + re_path(r'^$',landingview), re_path(r'^landing/$',landingview), re_path(r'^getblogs/$',rowersviews.get_blog_posts), re_path(r'^login/', diff --git a/static/css/rowsandall.css b/static/css/rowsandall.css index 86682c66..4e6f3ab2 100644 --- a/static/css/rowsandall.css +++ b/static/css/rowsandall.css @@ -26,6 +26,7 @@ background-image: url("/static/img/landing8b.jpg"); } + .watermark { position: absolute; float: center; diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index 2f0ccff9..9dd82684 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -26,6 +26,11 @@ background-image: url("/static/img/landing8b.jpg"); } +.errorlist { + color: red; +} + + .watermark { position: absolute; float: center;