Private
Public Access
1
0

print view

This commit is contained in:
Sander Roosendaal
2018-10-15 18:13:59 +02:00
parent 7b4006ae2c
commit 328070df52
6 changed files with 50 additions and 82 deletions

View File

@@ -38,11 +38,16 @@
<i class="fas fa-tasks fa-fw"></i>&nbsp;Link Workouts
</a>
</li>
<li id="sessions-coach/">
<a href="/rowers/sessions/coach">
<li id="sessions-coach">
<a href="/rowers/sessions/coach/">
<i class="fas fa-bullhorn fa-fw"></i>&nbsp;Coach View
</a>
</li>
<li id="sessions-print">
<a href="/rowers/sessions/print/">
<i class="fas fa-print fa-fw"></i>&nbsp;Print View
</a>
</li>
</ul>
</li>
<li class="has-children" id="plan">

View File

@@ -1,100 +1,47 @@
{% extends "base.html" %}
{% extends "newbase.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">
{{ rower.user.first_name }} {{ rower.user.last_name }}
</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>
{% block main %}
<h1>Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
{% for ps in plannedsessions %}
<div class="grid_12 alpha" style="page-break-before: always, page-break-inside: avoid">
<h1><a href="/rowers/sessions/{{ ps.id }}">Session {{ ps.name }}</a></h1>
<h2><a href="/rowers/sessions/{{ ps.id }}">Session {{ ps.name }}</a></h2>
<table class="listtable shortpadded" width="80%">
<tr>
<th>On or after</th><td>{{ ps.startdate }}</td>
<th align="left">On or after</th><td>{{ ps.startdate }}</td>
</tr>
<tr>
<th>On or before</th><td>{{ ps.enddate }}</td>
<th align="left">On or before</th><td>{{ ps.enddate }}</td>
</tr>
<tr>
<th>Session Type</th><td>{{ ps.sessiontype }}</td>
<th align="left">Session Type</th><td>{{ ps.sessiontype }}</td>
</tr>
<tr>
<th>Session Mode</th><td>{{ ps.sessionmode }}</td>
<th align="left">Session Mode</th><td>{{ ps.sessionmode }}</td>
</tr>
<tr>
<th>Criteria</th><td>{{ ps.criterium }}</td>
<th align="left">Criteria</th><td>{{ ps.criterium }}</td>
</tr>
<tr>
<th>Value</th><td>{{ ps.sessionvalue }}</td>
<th align="left">Value</th><td>{{ ps.sessionvalue }}</td>
</tr>
<tr>
<th>Unit</th><td>{{ ps.sessionunit }}</td>
<th align="left">Unit</th><td>{{ ps.sessionunit }}</td>
</tr>
<tr>
<th>Comment</th><td>{{ ps.comment|linebreaks }}</td>
<th align="left">Comment</th><td>{{ ps.comment|linebreaks }}</td>
</tr>
</table>
</div>
{% endfor %}
{% endblock %}
{% block sidebar %}
{% include 'menu_plan.html' %}
{% endblock %}

View File

@@ -477,7 +477,8 @@ urlpatterns = [
views.plannedsessions_manage_view),
url(r'^sessions/manage/user/(?P<userid>\d+)/$',
views.plannedsessions_manage_view),
url(r'^sessions/coach$',views.plannedsessions_coach_view),
url(r'^sessions/coach/$',views.plannedsessions_coach_view),
url(r'^sessions/coach/user/\d+/$',views.plannedsessions_coach_view),
url(r'^sessions/print/?$',views.plannedsessions_print_view),
url(r'^sessions/print/user/(?P<userid>\d+)$',views.plannedsessions_print_view),
url(r'^sessions/$',views.plannedsessions_view),

View File

@@ -14279,10 +14279,16 @@ def plannedsessions_view(request,timeperiod='thisweek',userid=0):
})
@login_required()
def plannedsessions_print_view(request,timeperiod='thisweek',userid=0):
def plannedsessions_print_view(request,userid=0):
r = getrequestrower(request,userid=userid)
when = request.GET.get('when')
if when:
timeperiod = when
else:
timeperiod = 'thisweek'
startdate,enddate = get_dates_timeperiod(timeperiod)
try:
@@ -14305,6 +14311,7 @@ def plannedsessions_print_view(request,timeperiod='thisweek',userid=0):
'plan':trainingplan,
'plannedsessions':sps,
'rower':r,
'active':'nav-plan',
'startdate':startdate,
'enddate':enddate,
'timeperiod':timeperiod,

View File

@@ -85,12 +85,14 @@ cox {
*/
th {
font-weight: bold;
font-weight: bold;
align: left;
}
.listtable tbody tr:nth-of-type(even) { background-color: #DDD; }
.listtable thead th {
font-weight: bold;
align: left;
}

View File

@@ -499,28 +499,30 @@
padding: 5px;
}
@media (min-height: 600px) {
@media (min-height: 600px) {
.maxheight {
max-height: 450px;
overflow: scroll;
}
}
@media (min-height: 600px) {
@media (min-height: 600px) {
.maxheight {
max-height: 450px;
overflow: scroll;
}
}
@media (min-height: 800px) {
@media (min-height: 800px) {
.maxheight {
max-height: 600px;
overflow: scroll;
}
}
@media (min-height: 1000px) {
@media (min-height: 1000px) {
.maxheight {
max-height: 800px;
overflow: scroll;
@@ -528,7 +530,7 @@
}
@media (max-width: 600px) {
@media (max-width: 600px) {
nav a {
font-size: 0px;
}
@@ -538,7 +540,7 @@
}
}
@media (min-width: 450px) {
@media (min-width: 450px) {
.wrapper {
grid-template-columns: 1fr 3fr;
grid-template-areas:
@@ -583,7 +585,7 @@
}
@media (min-width: 768px) {
@media (min-width: 768px) {
.wrapper {
grid-template-columns: 1fr 4fr 1fr;
grid-template-areas:
@@ -624,6 +626,10 @@
}
@media print {
header, user, nav, aside, footer {
display: none;
}
aside .cd-accordion-menu.animated label::before {
/* this class is used if you're using jquery to animate the accordion */