Merge branch 'release/v11.95'
This commit is contained in:
180
rowers/templates/plannedsessionscoach2.html
Normal file
180
rowers/templates/plannedsessionscoach2.html
Normal file
@@ -0,0 +1,180 @@
|
||||
{% extends "newbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Planned Sessions{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if theteam %}
|
||||
<h1>Group Overview. Team {{ theteam.name }}</h1>
|
||||
{% else %}
|
||||
<h1>Group Overview</h1>
|
||||
{% endif %}
|
||||
|
||||
<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/coach/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
|
||||
{{ timeperiod|timedeltadays }} days</a>
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
|
||||
|
||||
<table width="90%" class="listtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left">Session</th>
|
||||
{% for thedict in statusdict %}
|
||||
<td>
|
||||
<a href="/rowers/sessions/{{ thedict|lookup:"id" }}">
|
||||
{% if thedict|lookup:'name' %}
|
||||
{{ thedict|lookup:'name' }}
|
||||
{% else %}
|
||||
Unnamed Session
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left">On or after</th>
|
||||
{% for thedict in statusdict %}
|
||||
<td>
|
||||
{{ thedict|lookup:'startdate'|date:"Y-m-d" }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left">On or before</th>
|
||||
{% for thedict in statusdict %}
|
||||
<td>
|
||||
{{ thedict|lookup:'enddate'|date:"Y-m-d" }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left">Preferred Date</th>
|
||||
{% for thedict in statusdict %}
|
||||
<td>
|
||||
{{ thedict|lookup:'preferreddate'|date:"Y-m-d" }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr >
|
||||
<td colspan="100%"> </td>
|
||||
</tr>
|
||||
{% for r in rowers %}
|
||||
<tr>
|
||||
<th>
|
||||
{{ r.user.first_name }} {{ r.user.last_name }}
|
||||
</th>
|
||||
{% for thedict in statusdict %}
|
||||
<td>
|
||||
{% if thedict|lookup:'results'|lookup:r.id != 'not assigned' %}
|
||||
<a class="{{ thedict|lookup:'color'|lookup:r.id }} dot"
|
||||
title="{{ thedict|lookup:'results'|lookup:r.id }}"
|
||||
href="{% url 'plannedsession_view' id=thedict|lookup:"id" userid=r.user.id %}"> </a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<a href="/rowers/sessions/sendcalendar/user/{{ rower.user.id }}/?when={{ timeperiod }}">
|
||||
Get Calendar File</a>
|
||||
</p>
|
||||
{% if rower|is_coach:rowers %}
|
||||
<p>
|
||||
<a href="/rowers/sessions/coach/sendcalendar/user/{{ rower.user.id }}/?when={{ timeperiod }}">
|
||||
Send Calendar File to all rowers
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
{% if unmatchedworkouts %}
|
||||
<li class="grid_4">
|
||||
<h1>Workouts that are not linked to any session</h1>
|
||||
<table width="90%" class="listtable shortpadded">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Rower</th>
|
||||
<th style="width:80"> Date</th>
|
||||
<th> Time</th>
|
||||
<th> Name</th>
|
||||
<th> Type</th>
|
||||
<th> Distance </th>
|
||||
<th> Duration </th>
|
||||
<th> Avg HR </th>
|
||||
<th> Max HR </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for workout in unmatchedworkouts %}
|
||||
<tr>
|
||||
<td> {{ workout.user.user.first_name }} {{ workout.user.user.last_name }} </td>
|
||||
<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>
|
||||
</li>
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_plan.html' %}
|
||||
{% endblock %}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user