Private
Public Access
1
0
Files
rowsandall/rowers/templates/plannedsessions.html
2022-03-31 16:01:01 +02:00

310 lines
9.8 KiB
HTML

{% extends "newbase.html" %}
{% load static %}
{% load rowerfilters %}
{% block title %}Planned Sessions{% endblock %}
{% block main %}
<h1>Planned Sessions for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
<p>
<a href="/rowers/sessions/create/?when={{ timeperiod }}"> <i class="fas fa-calendar-plus fa-fw"></i>&nbsp;Add Session
</a>
{% if request.user|user_teams %}
<a href="/rowers/sessions/teamcreate/?when={{ timeperiod }}">
<i class="fas fa-whistle fa-fw"></i>&nbsp;Add Group Session
</a>
{% endif %}
<a href="/rowers/sessions/library/"><i class="fas fa-books fa-fw"></i>&nbsp;Add Session from Library</a>
</p>
<ul class="main-content">
<li class="grid_2">
<p>
<form enctype="multipart/form-data" method="get">
<table>
{{ dateform.as_table }}
</table>
<input type="Submit" value="Set Date Range">
</form>
</p>
</li>
<li class="grid_2">
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
{{ timeperiod|timedeltadays }} days</a>
</p>
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
{{ timeperiod|timedeltadays }} days</a>
</p>
</li>
<li class="grid_4">
{% if plannedsessions %}
<p>
Click on the session name to view, on the circle to attach workouts to the session.
</p>
<table width="90%" class="listtable shortpadded">
<thead>
<tr>
<th align="left">Status</th>
<th align="left">Date</th>
<th align="left">On or After</th>
<th align="left">On or Before</th>
<th align="left">Name</th>
<th align="left">Type</th>
<th align="left">Mode</th>
<th align="left">Edit</th>
<th align="left">Clone</th>
<th align="left">Delete</th>
<th align="left">Planned</th>
<th align="left">Actual</th>
<th align="left">&nbsp;</th>
<th align="left">Completion Date</th>
<th align="left">
</tr>
</thead>
<tbody>
{% for ps in plannedsessions %}
<tr>
<td>
{% if ps.sessiontype != 'race' %}
<a class="{{ sessioncolor|lookup:ps.id }} dot"
title="{{ completeness|lookup:ps.id }}"
href="/rowers/sessions/manage/session/{{ ps.id }}/user/{{ rower.user.id }}/?when={{ timeperiod }}">
&nbsp;</a>
{% else %}
<a
class="{{ sessioncolor|lookup:ps.id }} dot"
title="{{ completeness|lookup:ps.id }}"
href="/rowers/virtualevent/{{ ps.id }}/submit">&nbsp;</a>
{% endif %}
</td>
<td> {{ ps.preferreddate|date:"Y-m-d"}} </td>
<td> {{ ps.startdate|date:"Y-m-d" }} </td>
<td> {{ ps.enddate|date:"Y-m-d" }} </td>
<td>
{% if ps.sessiontype != 'race' %}
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/user/{{ rower.user.id }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/user/{{ rower.user.id }}">Unnamed Session</a>
{% endif %}
{% else %}
{% if ps.name != '' %}
<a class="small"
href="/rowers/virtualevent/{{ ps.id }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/virtualevent/{{ ps.id }}">Unnamed Race</a>
{% endif %}
{% endif %}
</td>
<td> {{ ps.get_sessiontype_display }} </td>
<td> {{ ps.get_sessionmode_display }} </td>
<td>
{% if ps.manager == request.user %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/edit/user/{{ rower.user.id }}/?when={{ timeperiod }}"><i class="fas fa-pencil-alt fa-fw"></i></a>
{% else %}
&nbsp;
{% endif %}
</td>
<td>
{% if ps.manager == request.user %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}"><i class="fas fa-clone fa-fw"></i></a>
{% else %}
&nbsp;
{% endif %}
</td>
<td>
{% if ps.manager == request.user %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i></a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/removeme/"><i class="fas fa-user-times"></i></a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ actualvalue|lookup:ps.id }}</td>
<td> {{ ps.sessionunit }} </td>
{% if completeness|lookup:ps.id != 'on target' %}
<td style="color:darkgray"><em> {{ completiondate|lookup:ps.id|date:"Y-m-d" }}</em></td>
{% else %}
<td> {{ completiondate|lookup:ps.id|date:"Y-m-d" }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
You have no planned workouts for this period. Planned workouts are created
by your coach if you are part of a team. You can create your own
planned workouts by purchasing the "Coach" or "Self-Coach" plans.
{% endif %}
<p>
<a
href="/rowers/sessions/print/user/{{ rower.user.id }}/?when={{ timeperiod }}">
Print View</a>
&nbsp;
<a
href="/rowers/sessions/sendcalendar/user/{{ rower.user.id }}/?when={{ timeperiod }}">
Get Calendar File</a>
&nbsp;
{% if user.is_authenticated and user.is_staff %}
<a
href="/rowers/sessions/saveasplan/user/{{ rower.user.id }}/?when={{ timeperiod }}">
Save to YaML</a>
&nbsp;
{% endif %}
<a
href="/rowers/plan/0/execution/?when={{ timeperiod }}/">
Actual vs Plan chart
</a>
</p>
</li>
<li class="grid_4">
{% if unmatchedworkouts %}
<h2>Workouts that are not linked to any session</h2>
<p>
<table width="90%" class="listtable shortpadded">
<thead>
<tr>
<th style="width:80"> Date</th>
<th align="left"> Time</th>
<th align="left"> Name</th>
<th align="left"> Type</th>
<th align="left"> Distance </th>
<th align="left"> Duration </th>
<th align="left"> Avg HR </th>
<th align="left"> Max HR </th>
</tr>
</thead>
<tbody>
{% for workout in unmatchedworkouts %}
<tr>
<td> {{ workout.date|date:"Y-m-d" }} </td>
<td> {{ workout.starttime|date:"H:i" }} </td>
{% if workout.user.user == user or user == team.manager %}
{% if workout.name != '' %}
<td>
<a href={% url rower.defaultlandingpage id=workout.id|encode %}>
{{ workout.name }}
</a>
</td>
{% else %}
<td>
<a href={% url rower.defaultlandingpage id=workout.id|encode %}>No Name
</a></td>
{% endif %}
{% else %}
{% if workout.name != '' %}
<td><a href="/rowers/workout/{{ workout.id|encode }}/">{{ workout.name }}</a></td>
{% else %}
<td><a href="/rowers/workout/{{ workout.id|encode }}/">No Name</a> </td>
{% endif %}
{% endif %}
<td> {{ workout.workouttype }} </td>
<td> {{ workout.distance }}m</td>
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</p>
</li>
<li class="grid_2">
<p>
<table width="90%" class="listtable shortpadded">
<thead>
<tr>
<th>&nbsp;</th>
<th>Distance</th>
<th>Time (minutes)</th>
<th>rScore</th>
<th>TRIMP</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Total
</td>
<td>
{{ totals|lookup:'distance' }}
</td>
<td>
{{ totals|lookup:'time' }}
</td>
<td>
{{ totals|lookup:'rscore' }}
</td>
<td>
{{ totals|lookup:'trimp' }}
</td>
</tr>
<tr>
<td>
Planned
</td>
<td>
{{ totals|lookup:'planneddistance' }}
</td>
<td>
{{ totals|lookup:'plannedtime' }}
</td>
<td>
{{ totals|lookup:'plannedrscore' }}
</td>
<td>
{{ totals|lookup:'plannedtrimp' }}
</td>
</tr>
<tr>
<td>
Actual
</td>
<td>
{{ totals|lookup:'actualdistance' }}
</td>
<td>
{{ totals|lookup:'actualtime' }}
</td>
<td>
{{ totals|lookup:'actualrscore' }}
</td>
<td>
{{ totals|lookup:'actualtrimp' }}
</td>
</tr>
</tbody>
</table>
</p>
<p>
Total is the total minutes, meters, rScore, TRIMP of all workouts in this
time period.
Planned time is the total time for sessions planned for time.
Actual time is the total time of workouts linked to sessions
planned for time.
Similarly for distance, rScore and TRIMP.
</p>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_plan.html' %}
{% endblock %}