diff --git a/rowers/templates/oterankings.html b/rowers/templates/oterankings.html index 278ac219..04dbec69 100644 --- a/rowers/templates/oterankings.html +++ b/rowers/templates/oterankings.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} @@ -8,175 +8,109 @@ {% block title %}Workouts{% endblock %} -{% block content %} +{% block main %} - - + + - {{ interactiveplot |safe }} +{{ interactiveplot |safe }} - - +{% if theuser %} +

{{ theuser.first_name }}'s Ranking Pieces

+{% else %} +

{{ user.first_name }}'s Ranking Pieces

+{% endif %} +
    +
  • +

    Summary for {{ theuser.first_name }} {{ theuser.last_name }} + between {{ startdate|date }} and {{ enddate|date }}

    -
    -
    - {% if theuser %} -

    {{ theuser.first_name }}'s Ranking Pieces

    - {% else %} -

    {{ user.first_name }}'s Ranking Pieces

    - {% endif %} -
    -
    - {% if user.is_authenticated and user|is_manager %} -
    - -
    - {% for member in user|team_members %} - {% if workouttype == 'water' %} - {{ member.first_name }} {{ member.last_name }} - {% else %} - {{ member.first_name }} {{ member.last_name }} - {% endif %} - {% endfor %} -
    - {% else %} -   - {% endif %} -
    -
    +

    The table gives the efforts you marked as Ranking Piece. + The graph shows the best segments from those pieces, plotted as + average power (over the segment) vs the duration of the segment/ + In other words: How long you can hold that power. +

    -
    -

    Summary for {{ theuser.first_name }} {{ theuser.last_name }} - between {{ startdate|date }} and {{ enddate|date }}

    +

    Whenever you load or reload the page, a new calculation is started + as a background process. The page will reload automatically when the + calculation is ready. +

    -

    Direct link for other users: - {% if workouttype == 'water' %} - https://rowsandall.com/rowers/{{ id }}/otw-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }} - {% else %} - https://rowsandall.com/rowers/{{ id }}/ote-ranking/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }} - {% endif %} -

    +

    At the bottom of the page, you will find predictions derived from the model.

    +
  • +
  • +

    Use this form to select a different date range:

    +

    + Select start and end date for a date range: +

    -

    The table gives the efforts you marked as Ranking Piece. - The graph shows the best segments from those pieces, plotted as - average power (over the segment) vs the duration of the segment/ - In other words: How long you can hold that power. -

    + + {{ dateform.as_table }} +
    + {% csrf_token %} + +
    +
  • +
  • -

    Whenever you load or reload the page, a new calculation is started - as a background process. The page will reload automatically when - calculation is ready.

    -

    At the bottom of the page, you will find predictions derived from the model.

    - -
    -

    Use this form to select a different date range:

    -

    - Select start and end date for a date range: -

    - -
    - - - {{ dateform.as_table }} -
    - {% csrf_token %} -
    -
    - -
    -
    -
    - Or use the last {{ deltaform }} days. -
    -
    - {% csrf_token %} - - -
    -
    - - - -
    - -

    Critical Power Plot

    +

    Critical Power Plot

    {{ the_div|safe }} -
    +
  • -
    +
  • -

    Ranking Piece Results

    +

    Ranking Piece Results

    - {% if rankingworkouts %} + {% if rankingworkouts %} - - +
    + - - - - - - - + + + + + + + - - + + {% for workout in rankingworkouts %} - - - - - - - - - - + + + + + + + + + + - {% endfor %} - -
    Distance Duration Avg Power Date Avg HR Max HR Edit Distance Duration Avg Power Date Avg HR Max HR Edit
    {{ workout.distance }} m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ avgpower|lookup:workout.id }} W {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} - {{ workout.name }}
    {{ workout.distance }} m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ avgpower|lookup:workout.id }} W {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} + {{ workout.name }}
    - {% else %} -

    No ranking workouts found

    - {% endif %} + {% endfor %} + + + {% else %} +

    No ranking workouts found

    + {% endif %} -
  • + -
    -

    Pace predictions for Ranking Pieces

    +
  • +

    Pace predictions for Ranking Pieces

    -

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    +

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    -
    - +
    @@ -208,25 +142,25 @@
    Duration
    -
    +
  • -
    +
  • {{ form.value }} {{ form.pieceunit }} {% csrf_token %} -
  • -
    minutes -
    -
    - - -
    + + + -
    +
{% endblock %} + +{% block sidebar %} +{% include 'menu_analytics.html' %} +{% endblock %} diff --git a/rowers/templatetags/rowerfilters.py b/rowers/templatetags/rowerfilters.py index 0b6ca674..3ee73f33 100644 --- a/rowers/templatetags/rowerfilters.py +++ b/rowers/templatetags/rowerfilters.py @@ -286,7 +286,6 @@ def is_not_past_due(self): @register.filter def userurl(path,member): - print path pattern = re.compile('user\/\d+') userstring = 'user/%s' % member.id if pattern.search(path) is not None: diff --git a/rowers/urls.py b/rowers/urls.py index d7664a8f..9506f9ce 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -202,12 +202,12 @@ urlpatterns = [ url(r'^otw-bests/(?P\w+.*)/(?P\w+.*)$',views.otwrankings_view), url(r'^otw-bests/(?P\d+)$',views.otwrankings_view), url(r'^otw-bests/$',views.otwrankings_view), - url(r'^(?P\d+)/ote-ranking/(?P\w+.*)/(?P\w+.*)$',views.oterankings_view), - url(r'^(?P\d+)/ote-ranking/(?P\d+)$',views.oterankings_view), + url(r'^ote-ranking/user/(?P\d+)/(?P\w+.*)/(?P\w+.*)$',views.oterankings_view), + url(r'^ote-ranking/user/(?P\d+)/(?P\d+)$',views.oterankings_view), url(r'^ote-ranking/(?P\w+.*)/(?P\w+.*)$',views.oterankings_view), url(r'^ote-ranking/(?P\d+)$',views.oterankings_view), url(r'^ote-ranking/$',views.oterankings_view), - url(r'^(?P\d+)/ote-ranking/$',views.oterankings_view), + url(r'^ote-ranking/user/(?P\d+)/$',views.oterankings_view), url(r'^(?P\d+)/flexall/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)$',views.cum_flex), url(r'^flexall/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)$',views.cum_flex), url(r'^flexall/(?P\w+.*)/(?P\w+.*)/(?P\w+.*)$',views.cum_flex), diff --git a/rowers/views.py b/rowers/views.py index a6cea7b6..6cc6f3f7 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -4798,6 +4798,8 @@ def oterankings_view(request,theuser=0, {'rankingworkouts':theworkouts, 'interactiveplot':script, 'the_div':div, + 'rower':r, + 'active':'nav-analysis', 'cpredictions':cpredictions, 'avgpower':avgpower, 'form':form,