From f72dc7d206e7678bdd73c58fa272537f4ed01ffb Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Tue, 17 Sep 2019 14:10:34 +0200 Subject: [PATCH] Save more space in week printout. Advances #26. --- .../static/css/alsijil/full_register.css | 9 ++++ .../alsijil/print/full_register.html | 49 ++++++++++--------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/biscuit/apps/alsijil/static/css/alsijil/full_register.css b/biscuit/apps/alsijil/static/css/alsijil/full_register.css index 0d771fd94..cfcc33406 100644 --- a/biscuit/apps/alsijil/static/css/alsijil/full_register.css +++ b/biscuit/apps/alsijil/static/css/alsijil/full_register.css @@ -120,6 +120,15 @@ tr:nth-child(even) { background-color: #f2f2f2; } +tr.lessons-day-first { + border-top: 2px solid; +} + +th.lessons-day-head { + writing-mode: tb-rl; + transform: rotate(-180deg); +} + tr.lesson-substituted { background-color: #ffc107; } diff --git a/biscuit/apps/alsijil/templates/alsijil/print/full_register.html b/biscuit/apps/alsijil/templates/alsijil/print/full_register.html index a95cc646a..92221aa5f 100644 --- a/biscuit/apps/alsijil/templates/alsijil/print/full_register.html +++ b/biscuit/apps/alsijil/templates/alsijil/print/full_register.html @@ -118,24 +118,23 @@ <section class="sheet padding-10mm smallprint"> <h2>{% trans 'Lesson documentation for calendar week' %} {{ week.week }}</h2> - {% for day in week %} - {% if periods_by_day|get_dict:day %} - <h3>{{ day }}</h3> - - <table> - <thead> - <tr> - <th>{% trans 'Pe.' %}</th> - <th>{% trans 'Subj.' %}</th> - <th>{% trans 'Subs.' %}</th> - <th>{% trans 'Lesson topic' %}</th> - <th>{% trans 'Homework' %}</th> - <th>{% trans 'Notes' %}</th> - <th>{% trans 'Te.' %}</th> - </tr> - </thead> - <tbody> - {% for period, documentations, notes, substitution in periods_by_day|get_dict:day %} + <table> + <thead> + <tr> + <th></th> + <th>{% trans 'Pe.' %}</th> + <th>{% trans 'Subj.' %}</th> + <th>{% trans 'Subs.' %}</th> + <th>{% trans 'Lesson topic' %}</th> + <th>{% trans 'Homework' %}</th> + <th>{% trans 'Notes' %}</th> + <th>{% trans 'Te.' %}</th> + </tr> + </thead> + <tbody> + {% for day in week %} + {% with periods_by_day|get_dict:day as periods %} + {% for period, documentations, notes, substitution in periods %} <tr class=" {% if substitution %} {% if substitution.cancelled %} @@ -144,7 +143,13 @@ lesson-substituted {% endif %} {% endif %} + {% if forloop.first %} + lessons-day-first + {% endif %} "> + {% if forloop.first %} + <th rowspan="{{ periods|length }}" class="lessons-day-head">{{ day }}</th> + {% endif %} <td class="lesson-pe">{{ period.period.period }}</td> <td class="lesson-subj">{{ period.lesson.subject.abbrev }}</td> <td class="lesson-subs">{{ substitution.subject.abbrev }}</td> @@ -186,10 +191,10 @@ </td> </tr> {% endfor %} - </tbody> - </table> - {% endif %} - {% endfor %} + {% endwith %} + {% endfor %} + </tbody> + </table> </section> {% endfor %} </body> -- GitLab