From a3e61ec215697f300493bca9454eeff2612276cb Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 15 May 2017 20:22:15 +0200 Subject: [PATCH] team stats page --- rowers/templates/list_workouts.html | 97 ++++++++++++----------- rowers/templates/multicompare.html | 8 +- rowers/templates/team.html | 10 ++- rowers/templates/team_compare_select.html | 4 +- rowers/templates/teambuttons.html | 13 ++- rowers/templates/teamstats.html | 33 ++++++++ rowers/templates/user_boxplot_select.html | 8 +- rowers/urls.py | 4 + rowers/views.py | 29 ++++++- 9 files changed, 143 insertions(+), 63 deletions(-) create mode 100644 rowers/templates/teamstats.html diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 9adf278b..02c69c36 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -33,55 +33,59 @@ -
- {% if team %} -
- {% include "teambuttons.html" with teamid=team.id %} -
-

{{ team.name }} Team Workouts

- {% else %} -

My Workouts

- {% endif %} +{% if team %} +
+ {% include "teambuttons.html" with teamid=team.id team=team %} +
+{% endif %} - {% if workouts %} - - - - - - - - - - - - {% if not team %} - - - {% else %} - - {% endif %} - +
+
+ {% if team %} +

{{ team.name }} Team Workouts

+ {% else %} +

My Workouts

+ {% endif %} + + {% if workouts %} +
Date Time Name Type Distance Duration Avg HR Max HR     - Owner -
+ + + + + + + + + + + {% if not team %} + + + {% else %} + + {% endif %} + - - {% for workout in workouts %} - - - - - {% else %} - No Name + + {% for workout in workouts %} + + + + + {% else %} + No Name {% endif %} {% else %} - {% if workout.name != '' %} - {{ workout.name }} - {% else %} - No Name +{% if workout.name != '' %} +{{ workout.name }} +{% else %} +No Name {% endif %} {% endif %} @@ -114,6 +118,7 @@ {% endif %} +
{% if team %}
@@ -152,7 +157,7 @@
- +
diff --git a/rowers/templates/multicompare.html b/rowers/templates/multicompare.html index dfc5d717..74c16d61 100644 --- a/rowers/templates/multicompare.html +++ b/rowers/templates/multicompare.html @@ -34,11 +34,12 @@ +
+ {% include "teambuttons.html" with teamid=teamid team=team %} +
+

Interactive Comparison

-
- {% include "teambuttons.html" with teamid=teamid%} -
@@ -53,6 +54,7 @@
+
diff --git a/rowers/templates/team.html b/rowers/templates/team.html index b045a4c5..d112ea92 100644 --- a/rowers/templates/team.html +++ b/rowers/templates/team.html @@ -3,11 +3,13 @@ {% block title %}Team {% endblock %} {% block content %} -
-

{{ team.name }}

-
+
{% include "teambuttons.html" with teamid=team.id %}
+
+
+

{{ team.name }}

+

{{ team.notes }}

Manager: {{ team.manager.first_name }} {{ team.manager.last_name }}

@@ -90,7 +92,7 @@ {% endif %}
- +
diff --git a/rowers/templates/team_compare_select.html b/rowers/templates/team_compare_select.html index 162a36ee..0b3e8e5b 100644 --- a/rowers/templates/team_compare_select.html +++ b/rowers/templates/team_compare_select.html @@ -8,9 +8,7 @@
-
- {% include "teambuttons.html" with teamid=team.id %} -
+ {% include "teambuttons.html" with teamid=team.id team=team %}

{{ team.name }} Team Workouts

diff --git a/rowers/templates/teambuttons.html b/rowers/templates/teambuttons.html index 12351b95..e45b807e 100644 --- a/rowers/templates/teambuttons.html +++ b/rowers/templates/teambuttons.html @@ -14,7 +14,7 @@ Team Page

-
+
{% if user|is_manager and user|has_teams %}

Upload Workout @@ -23,3 +23,14 @@

 

{% endif %}
+
+ {% if team and team.manager == user %} +

+ + Team Stats + +

+ {% else %} +   + {% endif %} +
diff --git a/rowers/templates/teamstats.html b/rowers/templates/teamstats.html new file mode 100644 index 00000000..312097f4 --- /dev/null +++ b/rowers/templates/teamstats.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} + +{% block title %}Team {% endblock %} + +{% block content %} +
+ {% include "teambuttons.html" with teamid=team.id team=team %} +
+
+

{{ team.name }} Stats

+

+ Links to the cumulative statistics pages for your team's members +

+
Date Time Name Type Distance Duration Avg HR Max HR     + Owner +
{{ workout.date |truncatechars:15}} {{ workout.starttime }} - {% if workout.user.user == user or user == team.manager %} - {% if workout.name != '' %} - {{ workout.name }}
{{ workout.date |truncatechars:15}} {{ workout.starttime }} + {% if workout.user.user == user or user == team.manager %} + {% if workout.name != '' %} + {{ workout.name }} {{ workout.workouttype }}
+ + {% for u in theusers %} + + + + + + + + + {% endfor %} + +
{{ u.first_name }} {{ u.last_name }}Ranking PiecesStroke AnalysisPower HistogramStatsBox Chart
+
+ + + + +{% endblock %} diff --git a/rowers/templates/user_boxplot_select.html b/rowers/templates/user_boxplot_select.html index 923ceb84..cb9ee37f 100644 --- a/rowers/templates/user_boxplot_select.html +++ b/rowers/templates/user_boxplot_select.html @@ -7,11 +7,11 @@ {% block content %} + {% if team %}
-
- {% include "teambuttons.html" with teamid=team.id %} -
+ {% include "teambuttons.html" with teamid=team.id team=team %}
+{% endif %}
{% if theuser %} @@ -20,7 +20,7 @@

{{ user.first_name }}'s Workouts

{% endif %}
-
+
{% if user.is_authenticated and user|is_manager %}