navigation for coach view
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<div class="grid_2 dropdown">
|
||||
<button class="grid_2 alpha button green small dropbtn">
|
||||
See individual plans for Rower
|
||||
Select Rower Individual Plan
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_rowers %}
|
||||
@@ -118,6 +118,61 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if unmatchedworkouts %}
|
||||
<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 %}>
|
||||
{{ workout.name }}
|
||||
</a>
|
||||
</td>
|
||||
{% else %}
|
||||
<td>
|
||||
<a href={% url rower.defaultlandingpage id=workout.id %}>No Name
|
||||
</a></td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if workout.name != '' %}
|
||||
<td><a href="/rowers/workout/{{ workout.id }}/">{{ workout.name }}</a></td>
|
||||
{% else %}
|
||||
<td><a href="/rowers/workout/{{ workout.id }}/">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 %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -32,12 +32,23 @@
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<div class="grid_2">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
{% if timeperiod %}
|
||||
<a class="button gray small" href="/rowers/sessions/teamcreate/{{ timeperiod }}">Add Team Session</a>
|
||||
{% else %}
|
||||
<a class="button gray small" href="/rowers/session/teamcreate">Add Team Session</a>
|
||||
<a class="button gray small" href="/rowers/sessions/teamcreate">Add Team Session</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
{% if timeperiod %}
|
||||
<a class="button gray small" href="/rowers/sessions/coach/{{ timeperiod }}">Coach Overview</a>
|
||||
{% else %}
|
||||
<a class="button gray small" href="/rowers/sessions/coach">Coach Overview</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
||||
|
||||
@@ -11894,6 +11894,14 @@ def plannedsessions_coach_view(request,timeperiod='thisweek',
|
||||
}
|
||||
statusdict[ps.id] = sessiondict
|
||||
|
||||
unmatchedworkouts = []
|
||||
for r in rowers:
|
||||
unmatchedworkouts += Workout.objects.filter(
|
||||
user=r,
|
||||
plannedsession=None,
|
||||
date__gte=startdate,date__lte=enddate)
|
||||
|
||||
|
||||
myteams = Team.objects.filter(manager=request.user)
|
||||
|
||||
return render(request,'plannedsessionscoach.html',
|
||||
@@ -11904,6 +11912,8 @@ def plannedsessions_coach_view(request,timeperiod='thisweek',
|
||||
'timeperiod':timeperiod,
|
||||
'rowers':rowers,
|
||||
'theteam':theteam,
|
||||
'unmatchedworkouts':unmatchedworkouts,
|
||||
'rower':getrower(request.user)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -139,9 +139,10 @@ cox {
|
||||
|
||||
.listtable tbody tr:nth-of-type(even) { background-color: #DDD; }
|
||||
.listtable thead th {
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.shortpadded td { padding: 3px 3px }
|
||||
|
||||
.paddedtable td { padding: 1px 20px }
|
||||
|
||||
Reference in New Issue
Block a user