rower switcher on stats pages
This commit is contained in:
@@ -1043,18 +1043,18 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
||||
# test if we have drive energy
|
||||
nowork = 1
|
||||
try:
|
||||
test = rowdata['driveenergy'].mean()
|
||||
test = datadf['driveenergy'].mean()
|
||||
nowork = 0
|
||||
except KeyError:
|
||||
rowdata['driveenergy'] = 500.
|
||||
datadf['driveenergy'] = 500.
|
||||
|
||||
# test if we have power
|
||||
nopower = 1
|
||||
try:
|
||||
test = rowdata['power'].mean()
|
||||
test = datadf['power'].mean()
|
||||
nopower = 0
|
||||
except KeyError:
|
||||
rowdata['power'] = 50.
|
||||
datadf['power'] = 50.
|
||||
|
||||
|
||||
yparamname1 = axlabels[yparam1]
|
||||
|
||||
@@ -24,7 +24,28 @@
|
||||
|
||||
|
||||
<div id="title" class="grid_12 alpha">
|
||||
<h1>Stroke Analysis</h1>
|
||||
<div class="grid_10 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Stroke Analysis</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Stroke Analysis</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
Change Rower
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a class="button green small" href="/rowers/{{ member.id }}/flexall/{{ xparam }}/{{ yparam1 }}/{{ yparam2 }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_12 alpha">
|
||||
|
||||
@@ -35,11 +35,28 @@
|
||||
|
||||
|
||||
<div class="grid_12 alpha">
|
||||
<h1>Workout Statistics</h1>
|
||||
<p>
|
||||
This is an experimental page which just lists a bunch of statistics for
|
||||
your workouts. This page is under rapid development.
|
||||
</p>
|
||||
<div class="grid_4 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Workout Statistics</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Workout Statistics</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 suffix_6 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
Change Rower
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a class="button green small" href="/rowers/{{ member.id }}/cumstats/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/p/{{ plotfield }}">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div id="summary" class="grid_6 alpha">
|
||||
|
||||
@@ -35,7 +35,28 @@
|
||||
|
||||
|
||||
<div id="title" class="grid_12 alpha">
|
||||
<h1>Indoor Rower Power Histogram</h1>
|
||||
<div class="grid_10 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Indoor Rower Power Histogram</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Indoor Rower Power Histogram</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
Change Rower
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a class="button green small" href="/rowers/{{ member.id }}/histo/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="summary" class="grid_6 alpha">
|
||||
|
||||
@@ -35,7 +35,28 @@
|
||||
|
||||
|
||||
<div id="title" class="grid_12 alpha">
|
||||
<h1>Ranking Pieces (Indoor Rower)</h1>
|
||||
<div class="grid_10 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Ranking Pieces</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Ranking Pieces</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
Change Rower
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a class="button green small" href="/rowers/{{ member.id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="summary" class="grid_6 alpha">
|
||||
|
||||
@@ -13,11 +13,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Workouts</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Workouts</h3>
|
||||
{% endif %}
|
||||
<div class="grid_4 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Workouts</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Workouts</h3>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 suffix_6 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
Change Rower
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a class="button green small" href="/rowers/user-boxplot-select/user/{{ member.id }}/">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_4 alpha">
|
||||
|
||||
@@ -125,3 +125,17 @@ def has_teams(user):
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
@register.filter
|
||||
def team_members(user):
|
||||
try:
|
||||
therower = Rower.objects.get(user=user)
|
||||
if therower.rowerplan != 'coach':
|
||||
return []
|
||||
teams = Team.objects.filter(manager=user)
|
||||
members = Rower.objects.filter(team__in=teams)
|
||||
return [rower.user for rower in members]
|
||||
except TypeError:
|
||||
return []
|
||||
|
||||
return []
|
||||
|
||||
@@ -124,7 +124,7 @@ urlpatterns = [
|
||||
url(r'^team-compare-select/team/(?P<teamid>\d+)/$',views.team_comparison_select),
|
||||
url(r'^team-compare-select/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.team_comparison_select),
|
||||
url(r'^team-compare-select/$',views.team_comparison_select),
|
||||
url(r'^user-boxplot-select/team/(?P<userid>\d+)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.user_boxplot_select),
|
||||
url(r'^user-boxplot-select/user/(?P<userid>\d+)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.user_boxplot_select),
|
||||
url(r'^user-boxplot-select/user/(?P<userid>\d+)/$',views.user_boxplot_select),
|
||||
url(r'^user-boxplot-select/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.user_boxplot_select),
|
||||
url(r'^user-boxplot-select/$',views.user_boxplot_select),
|
||||
@@ -135,7 +135,7 @@ urlpatterns = [
|
||||
url(r'^ote-bests/(?P<deltadays>\d+)$',views.rankings_view),
|
||||
url(r'^ote-bests/$',views.rankings_view),
|
||||
url(r'^(?P<theuser>\d+)/ote-bests/$',views.rankings_view),
|
||||
|
||||
url(r'^(?P<theuser>\d+)/flexall/(?P<xparam>\w+.*)/(?P<yparam1>\w+.*)/(?P<yparam2>\w+.*)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.cum_flex),
|
||||
url(r'^flexall/(?P<xparam>\w+.*)/(?P<yparam1>\w+.*)/(?P<yparam2>\w+.*)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.cum_flex),
|
||||
url(r'^flexall/(?P<xparam>\w+.*)/(?P<yparam1>\w+.*)/(?P<yparam2>\w+.*)$',views.cum_flex),
|
||||
url(r'^flexall/$',views.cum_flex),
|
||||
|
||||
Reference in New Issue
Block a user