added plan print view
This commit is contained in:
@@ -130,6 +130,9 @@
|
|||||||
by your coach if you are part of a team. You can create your own
|
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.
|
planned workouts by purchasing the "Coach" or "Self-Coach" plans.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<p>
|
||||||
|
<a class="grid_2 button gray" href="/rowers/sessions/print/{{ timeperiod }}/rower/{{ rower.id }}">Print View</a>
|
||||||
|
<p>
|
||||||
{% if unmatchedworkouts %}
|
{% if unmatchedworkouts %}
|
||||||
<h1>Workouts that are not linked to any session</h1>
|
<h1>Workouts that are not linked to any session</h1>
|
||||||
<table width="90%" class="listtable shortpadded">
|
<table width="90%" class="listtable shortpadded">
|
||||||
|
|||||||
100
rowers/templates/plannedsessions_print.html
Normal file
100
rowers/templates/plannedsessions_print.html
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
{% block title %}Planned Sessions{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="grid_12 alpha">
|
||||||
|
{% include "planningbuttons.html" %}
|
||||||
|
</div>
|
||||||
|
<div class="grid_6 alpha">
|
||||||
|
<h1>Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
||||||
|
<p>
|
||||||
|
From {{ startdate }} to {{ enddate }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="timeperiod" class="grid_2 dropdown">
|
||||||
|
<button class="grid_2 alpha button gray small dropbtn">Select Time Period ({{ timeperiod|verbosetimeperiod }})</button>
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/today/rower/{{ rower.id }}">
|
||||||
|
Today
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/thisweek/rower/{{ rower.id }}">
|
||||||
|
This Week
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/thismonth/rower/{{ rower.id }}">
|
||||||
|
This Month
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/lastweek/rower/{{ rower.id }}">
|
||||||
|
Last Week
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/lastmonth/rower/{{ rower.id }}">
|
||||||
|
Last Month
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/nextweek/rower/{{ rower.id }}">
|
||||||
|
Next Week
|
||||||
|
</a>
|
||||||
|
<a class="button gray small alpha"
|
||||||
|
href="/rowers/sessions/print/nextmonth/rower/{{ rower.id }}">
|
||||||
|
Next Month
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% if user.is_authenticated and user|is_manager %}
|
||||||
|
<div class="grid_2 dropdown">
|
||||||
|
<button class="grid_2 alpha button green small dropbtn">
|
||||||
|
Change Rower
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-content">
|
||||||
|
{% for member in user|team_rowers %}
|
||||||
|
<a class="button green small" href="/rowers/sessions/print/{{ timeperiod }}/rower/{{ member.id }}">{{ member.user.first_name }} {{ member.user.last_name }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="grid_2 omega">
|
||||||
|
<a class="button small gray" href="/rowers/list-courses">Courses</a>
|
||||||
|
</div>
|
||||||
|
{% for ps in plannedsessions %}
|
||||||
|
<div class="grid_12 alpha">
|
||||||
|
<h1><a href="/rowers/sessions/{{ ps.id }}">Session {{ ps.name }}</a></h1>
|
||||||
|
<table class="listtable shortpadded" width="80%">
|
||||||
|
<tr>
|
||||||
|
<th>On or after</th><td>{{ ps.startdate }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>On or before</th><td>{{ ps.enddate }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Session Type</th><td>{{ ps.sessiontype }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Session Mode</th><td>{{ ps.sessionmode }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Criteria</th><td>{{ ps.criterium }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Value</th><td>{{ ps.sessionvalue }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Unit</th><td>{{ ps.sessionunit }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Comment</th><td>{{ ps.comment|linebreaks }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -482,6 +482,10 @@ urlpatterns = [
|
|||||||
views.plannedsessions_coach_view),
|
views.plannedsessions_coach_view),
|
||||||
url(r'^sessions/coach/(?P<timeperiod>[\w\ ]+.*)$',
|
url(r'^sessions/coach/(?P<timeperiod>[\w\ ]+.*)$',
|
||||||
views.plannedsessions_coach_view),
|
views.plannedsessions_coach_view),
|
||||||
|
url(r'^sessions/print/?$',views.plannedsessions_print_view),
|
||||||
|
url(r'^sessions/print/rower/(?P<rowerid>\d+)$',views.plannedsessions_print_view),
|
||||||
|
url(r'^sessions/print/(?P<timeperiod>[\w\ ]+.*)/rower/(?P<rowerid>\d+)$',views.plannedsessions_print_view),
|
||||||
|
url(r'^sessions/print/(?P<timeperiod>[\w\ ]+.*)$',views.plannedsessions_print_view),
|
||||||
url(r'^sessions/?$',views.plannedsessions_view),
|
url(r'^sessions/?$',views.plannedsessions_view),
|
||||||
url(r'^sessions/rower/(?P<rowerid>\d+)$',views.plannedsessions_view),
|
url(r'^sessions/rower/(?P<rowerid>\d+)$',views.plannedsessions_view),
|
||||||
url(r'^sessions/(?P<timeperiod>[\w\ ]+.*)/rower/(?P<rowerid>\d+)$',views.plannedsessions_view),
|
url(r'^sessions/(?P<timeperiod>[\w\ ]+.*)/rower/(?P<rowerid>\d+)$',views.plannedsessions_view),
|
||||||
|
|||||||
@@ -12379,6 +12379,38 @@ def plannedsessions_view(request,timeperiod='thisweek',rowerid=0):
|
|||||||
'unmatchedworkouts':unmatchedworkouts,
|
'unmatchedworkouts':unmatchedworkouts,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@login_required()
|
||||||
|
def plannedsessions_print_view(request,timeperiod='thisweek',rowerid=0):
|
||||||
|
|
||||||
|
if rowerid==0:
|
||||||
|
r = getrower(request.user)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
r = Rower.objects.get(id=rowerid)
|
||||||
|
except Rower.DoesNotExist:
|
||||||
|
raise Http404("This rower doesn't exist")
|
||||||
|
if not checkaccessuser(request.user,r):
|
||||||
|
raise PermissionDenied("You don't have access to this plan")
|
||||||
|
|
||||||
|
startdate,enddate = get_dates_timeperiod(timeperiod)
|
||||||
|
|
||||||
|
sps = get_sessions(r,startdate=startdate,enddate=enddate)
|
||||||
|
|
||||||
|
completeness = {}
|
||||||
|
actualvalue = {}
|
||||||
|
completiondate = {}
|
||||||
|
|
||||||
|
return render(request,'plannedsessions_print.html',
|
||||||
|
{
|
||||||
|
'teams':get_my_teams(request.user),
|
||||||
|
'plannedsessions':sps,
|
||||||
|
'rower':r,
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
|
'timeperiod':timeperiod,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
@login_required()
|
@login_required()
|
||||||
def plannedsessions_manage_view(request,timeperiod='thisweek',rowerid=0,
|
def plannedsessions_manage_view(request,timeperiod='thisweek',rowerid=0,
|
||||||
initialsession=0):
|
initialsession=0):
|
||||||
|
|||||||
Reference in New Issue
Block a user