From 35eda691227fd8b140d48eb8957169c1f5f4284d Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 19 Mar 2020 21:06:08 +0100 Subject: [PATCH] rotated view --- rowers/templates/plannedsessionscoach2.html | 180 ++++++++++++++++++++ rowers/views/planviews.py | 7 +- 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 rowers/templates/plannedsessionscoach2.html diff --git a/rowers/templates/plannedsessionscoach2.html b/rowers/templates/plannedsessionscoach2.html new file mode 100644 index 00000000..5c38503e --- /dev/null +++ b/rowers/templates/plannedsessionscoach2.html @@ -0,0 +1,180 @@ +{% extends "newbase.html" %} +{% load staticfiles %} +{% load rowerfilters %} + +{% block title %}Planned Sessions{% endblock %} + +{% block main %} +{% if theteam %} +

Group Overview. Team {{ theteam.name }}

+{% else %} +

Group Overview

+{% endif %} + +
    +
  • +

    +

    + + {{ dateform.as_table }} +
    + +
    +

    +
  • +
  • +

    Back by + {{ timeperiod|timedeltadays }} days +

    +

    Forward by + {{ timeperiod|timedeltadays }} days +

    +
  • +
  • + + + + + + + {% for thedict in statusdict %} + + {% endfor %} + + + + {% for thedict in statusdict %} + + {% endfor %} + + + + {% for thedict in statusdict %} + + {% endfor %} + + + + {% for thedict in statusdict %} + + {% endfor %} + + + + + + + + {% for r in rowers %} + + + {% for thedict in statusdict %} + + {% endfor %} + + {% endfor %} + +
    Session + + {% if thedict|lookup:'name' %} + {{ thedict|lookup:'name' }} + {% else %} + Unnamed Session + {% endif %} + +
    On or after + {{ thedict|lookup:'startdate'|date:"Y-m-d" }} +
    On or before + {{ thedict|lookup:'enddate'|date:"Y-m-d" }} +
    Preferred Date + {{ thedict|lookup:'preferreddate'|date:"Y-m-d" }} +
     
    + {{ r.user.first_name }} {{ r.user.last_name }} + + {% if thedict|lookup:'results'|lookup:r.id != 'not assigned' %} +   + {% else %} +   + {% endif %} +
    +

    + + Get Calendar File +

    + {% if rower|is_coach:rowers %} +

    + + Send Calendar File to all rowers + +

    + {% endif %} +
  • + + {% if unmatchedworkouts %} +
  • +

    Workouts that are not linked to any session

    + + + + + + + + + + + + + + + + {% for workout in unmatchedworkouts %} + + + + + {% if workout.user.user == user or user == team.manager %} + {% if workout.name != '' %} + + {% else %} + + {% endif %} + + {% else %} + {% if workout.name != '' %} + + {% else %} + + {% endif %} + {% endif %} + + + + + + + {% endfor %} + +
    Rower Date Time Name Type Distance Duration Avg HR Max HR
    {{ workout.user.user.first_name }} {{ workout.user.user.last_name }} {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }} + + {{ workout.name }} + + + No Name + {{ workout.name }}No Name {{ workout.workouttype }} {{ workout.distance }}m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ workout.averagehr }} {{ workout.maxhr }}
    +
  • + + +{% endif %} + + + + +
+{% endblock %} + +{% block sidebar %} +{% include 'menu_plan.html' %} +{% endblock %} diff --git a/rowers/views/planviews.py b/rowers/views/planviews.py index f4ff5fbc..f7613d76 100644 --- a/rowers/views/planviews.py +++ b/rowers/views/planviews.py @@ -1014,7 +1014,12 @@ def plannedsessions_coach_view(request, 'enddate':enddate, }) - return render(request,'plannedsessionscoach.html', + ttemplate = 'plannedsessionscoach.html' + if len(rowers) > 5 and len(rowers) > len(sps): + ttemplate = 'plannedsessionscoach2.html' + + + return render(request,ttemplate, { 'myteams':myteams, 'plannedsessions':sps,