From 328070df520c294b22ef6ea898c82ced255332d5 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 15 Oct 2018 18:13:59 +0200 Subject: [PATCH] print view --- rowers/templates/menu_plan.html | 9 ++- rowers/templates/plannedsessions_print.html | 87 ++++----------------- rowers/urls.py | 3 +- rowers/views.py | 9 ++- static/css/rowsandall2.css | 4 +- static/css/styles2.css | 20 +++-- 6 files changed, 50 insertions(+), 82 deletions(-) diff --git a/rowers/templates/menu_plan.html b/rowers/templates/menu_plan.html index 3545b52e..7ddb10d6 100644 --- a/rowers/templates/menu_plan.html +++ b/rowers/templates/menu_plan.html @@ -38,11 +38,16 @@  Link Workouts -
  • - +
  • +  Coach View
  • +
  • + +  Print View + +
  • diff --git a/rowers/templates/plannedsessions_print.html b/rowers/templates/plannedsessions_print.html index 34b065fc..f09bb13e 100644 --- a/rowers/templates/plannedsessions_print.html +++ b/rowers/templates/plannedsessions_print.html @@ -1,100 +1,47 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} {% block title %}Planned Sessions{% endblock %} -{% block content %} -
    - {% include "planningbuttons.html" %} -
    -
    -

    Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}

    -

    - From {{ startdate }} to {{ enddate }} -

    -
    - -{% if user.is_authenticated and user|is_manager %} - -{% endif %} -
    - Courses -
    +{% block main %} +

    Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}

    + {% for ps in plannedsessions %} -
    -

    Session {{ ps.name }}

    +

    Session {{ ps.name }}

    - + - + - + - + - + - + - + - +
    On or after{{ ps.startdate }}On or after{{ ps.startdate }}
    On or before{{ ps.enddate }}On or before{{ ps.enddate }}
    Session Type{{ ps.sessiontype }}Session Type{{ ps.sessiontype }}
    Session Mode{{ ps.sessionmode }}Session Mode{{ ps.sessionmode }}
    Criteria{{ ps.criterium }}Criteria{{ ps.criterium }}
    Value{{ ps.sessionvalue }}Value{{ ps.sessionvalue }}
    Unit{{ ps.sessionunit }}Unit{{ ps.sessionunit }}
    Comment{{ ps.comment|linebreaks }}Comment{{ ps.comment|linebreaks }}
    -
    {% endfor %} +{% endblock %} + +{% block sidebar %} +{% include 'menu_plan.html' %} {% endblock %} diff --git a/rowers/urls.py b/rowers/urls.py index 1ff629a3..defa4a3e 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -477,7 +477,8 @@ urlpatterns = [ views.plannedsessions_manage_view), url(r'^sessions/manage/user/(?P\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\d+)$',views.plannedsessions_print_view), url(r'^sessions/$',views.plannedsessions_view), diff --git a/rowers/views.py b/rowers/views.py index fbc93fb8..166ebd4a 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -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, diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index c9b87d10..d0277526 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -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; } diff --git a/static/css/styles2.css b/static/css/styles2.css index c2a3040a..d890eb33 100644 --- a/static/css/styles2.css +++ b/static/css/styles2.css @@ -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 */