Skip to content
Snippets Groups Projects
Verified Commit 445f9c35 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Redesign full register printout using base_print.html

parent 43e6be1f
No related branches found
No related tags found
1 merge request!55Resolve "Use base_print.html for full register print out"
Pipeline #2781 passed
@page { table.small-print {
size: A4; font-size: 10pt;
} }
body { #signatures {
font-family: Arial, Helvetica, san-serif; padding-top: 3em;
font-size: 10pt;
} }
section.sheet.smallprint { #signatures .signature {
font-size: 8pt; display: inline-block;
width: 12em;
border-top: 1px solid;
margin-right: 20px;
} }
section.sheet.bigprint { tr {
font-size: 12pt; border-bottom: 1px solid rgba(0, 0, 0, 0.3);
} }
span.signature-line { td, th {
display: inline-block; padding: 1px;
width: 10em;
border-bottom: 1px solid;
}
#titlepage {
display: flex;
flex-direction: column;
justify-content: space-around;
}
#titlepage h1 {
text-align: center;
}
#titlepage img#school-logo {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
#titlepage p#group-desc {
font-weight: bold;
font-size: 150%;
text-align: center;
}
#titlepage p#printed-info {
text-align: center;
}
#titlepage p#group-owners {
font-size: 130%;
text-align: center;
}
#titlepage p#signatures {
padding-top: 2em;
}
table {
width: 100%;
border: 1px solid black;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
}
tr:nth-child(even) {
background-color: #f2f2f2;
} }
tr.lessons-day-first { tr.lessons-day-first {
border-top: 2px solid; border-top: 3px solid rgba(0, 0, 0, 0.3);
} }
th.lessons-day-head { th.lessons-day-head {
transform: rotate(-90deg); text-align: center;
transform: rotate(-90deg);
} }
tr.lesson-cancelled td.subj { tr.lesson-cancelled td.subj {
text-decoration: line-through; text-decoration: line-through;
} }
tr.lesson-cancelled td { tr.lesson-cancelled td {
background-color: #dc3545; background-color: #EF9A9A;
} }
tr.lesson-substituted td.lesson-subj { tr.lesson-substituted td.lesson-subj {
text-decoration: line-through; text-decoration: line-through;
} }
tr.lesson-substituted td { tr.lesson-substituted td {
background-color: #ffc107; background-color: #ffb74d;
} }
td.lesson-notes { td.lesson-notes {
font-size: 80%; font-size: 80%;
} }
td.lesson-notes span.lesson-note-absent { td.lesson-notes span.lesson-note-absent {
color: #cc0000; color: #cc0000;
} }
td.lesson-notes span.lesson-note-late { td.lesson-notes span.lesson-note-late {
color: #ff9933; color: #ff9933;
} }
td.lesson-notes span.lesson-note-excused { td.lesson-notes span.lesson-note-excused {
color: #009933; color: #009933;
} }
table.person-info { table.person-info {
border: none; border: none;
} }
table.person-info td.person-img { table.person-info td.person-img {
text-align: center; text-align: center;
} }
table.person-info td.person-img img { table.person-info td.person-img img {
max-height: 30mm; max-height: 30mm;
}
.sheet {
overflow: visible;
height: auto !important;
}
.sheet * {
page-break-inside: avoid;
} }
img.max-size-600 { img.max-size-600 {
max-width: 600px; max-width: 600px;
max-height: 600px; max-height: 600px;
}
img.center{
position: relative;
left: 50%;
transform: translateX(-50%);
} }
{% extends "core/base_print.html" %}
{% load static i18n cropping data_helpers week_helpers %} {% load static i18n cropping data_helpers week_helpers %}
<!DOCTYPE html> {% block page_title %}
<html> {% trans "Class register:" %} {{ group.name }}
<head> {% endblock %}
<meta charset="utf-8" />
<link rel="stylesheet"
href="{% static 'css/alsijil/paper.css' %}" />
<link rel="stylesheet"
href="{% static 'css/alsijil/full_register.css' %}" />
</head>
<body class="A4"> {% block extra_head %}
<section class="sheet padding-10mm bigprint" id="titlepage"> <link rel="stylesheet" href="{% static 'css/alsijil/full_register.css' %}"/>
<div> {% endblock %}
<h1>{% trans 'Class register' %}</h1>
{% static "img/aleksis-banner.svg" as aleksis_banner %} {% block content %}
<img src="{% firstof request.site.preferences.theme__logo.url aleksis_banner %}"
alt="{{ request.site.preferences.general__title }} – Logo" class="max-size-600 center"> <div class="center-align">
<p id="group-desc"> <h1>{% trans 'Class register' %}</h1>
{{ group.name }} {% static "img/aleksis-banner.svg" as aleksis_banner %}
</p> <img src="{% firstof request.site.preferences.theme__logo.url aleksis_banner %}"
<p id="group-owners"> alt="{{ request.site.preferences.general__title }} – Logo" class="max-size-600 center">
{% trans 'Owners' %}: <h4 id="group-desc">
{{ group.owners.all|join:', ' }} {{ group.name }}
</p> </h4>
<p id="printed-info"> <p id="group-owners" class="flow-text">
{% trans 'Printed on' %} {{ today }} {% trans 'Owners' %}:
</p> {{ group.owners.all|join:', ' }}
</div> </p>
<div> <p id="printed-info">
<hr /> {% trans 'Printed on' %} {{ today }}
</p>
</div>
<div>
<hr/>
</div>
<div>
<p>
{% blocktrans %}
This printout is intended for archival purposes. The main copy of
the class register is stored in the AlekSIS School Information
System.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
Copies of the class register, both digital and as printout, must
only be kept inside the school and/or on devices authorised by the
school.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
The owner of the group and the headteacher confirm the above, as
well as the correctness of this printout.
{% endblocktrans %}
</p>
<div id="signatures">
<div class="signature">
{% trans 'Owners' %}
</div> </div>
<div> <div class="signature">
<p> {% trans 'Headteacher' %}
{% blocktrans %}
This printout is intended for archival purposes. The main copy of
the class register is stored in the AlekSIS School Information
System.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
Copies of the class register, both digital and as printout, must
only be kept inside the school and/or on devices authorised by the
school.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
The owner of the group and the headteacher confirm the above, as
well as the correctness of this printout.
{% endblocktrans %}
</p>
<p id="signatures">
<span class="signature-line"></span> ({% trans 'Owners' %}),
<span class="signature-line"></span> ({% trans 'Headteacher' %})
</p>
</div> </div>
</section> </div>
</div>
<section class="sheet padding-10mm" id="persons-overview"> <div class="page-break">&nbsp;</div>
<h2>{% trans 'Persons in group' %} {{ group.name }}</h2>
<table id="persons"> <h4>{% trans 'Persons in group' %} {{ group.name }}</h4>
<thead>
<table id="persons">
<thead>
<tr>
<th>{% trans 'No.' %}</th>
<th>{% trans 'Last name' %}</th>
<th>{% trans 'First name' %}</th>
<th>{% trans 'Sex' %}</th>
<th>{% trans 'Date of birth' %}</th>
<th>{% trans 'Absences' %}</th>
<th>{% trans 'Unexcused' %}</th>
<th>{% trans 'Tard.' %}</th>
</tr>
</thead>
<tbody>
{% for person in persons %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ person.last_name }}</td>
<td>{{ person.first_name }}</td>
<td>{{ person.get_sex_display }}</td>
<td>{{ person.date_of_birth }}</td>
<td>{{ person.absences_count }}</td>
<td>{{ person.unexcused }}</td>
<td>{{ person.tardiness }}'</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="page-break">&nbsp;</div>
{% if group.lessons.all %}
<h4>{% trans 'Teachers and lessons in group' %} {{ group.name }}</h4>
<table id="lessons">
<thead>
<tr>
<th>{% trans 'Subject' %}</th>
<th>{% trans 'Teacher' %}</th>
<th>{% trans 'Lesson start' %}</th>
<th>{% trans 'Lesson end' %}</th>
<th>{% trans 'Per week' %}</th>
</tr>
</thead>
<tbody>
{% for lesson in group.lessons.all %}
<tr>
<td>{{ lesson.subject.name }}</td>
<td>{{ lesson.teachers.all|join:', ' }}</td>
<td>{{ lesson.date_start }}</td>
<td>{{ lesson.date_end }}</td>
<td>{{ lesson.lesson_periods.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="page-break">&nbsp;</div>
{% endif %}
{% if group.child_groups.all %}
<h4>{% trans 'Teachers and lessons in child groups' %}</h4>
<table id="lessons">
<thead>
<tr>
<th>{% trans 'Group' %}</th>
<th>{% trans 'Subject' %}</th>
<th>{% trans 'Teacher' %}</th>
<th>{% trans 'Lesson start' %}</th>
<th>{% trans 'Lesson end' %}</th>
<th>{% trans 'Per week' %}</th>
</tr>
</thead>
<tbody>
{% for child_group in group.child_groups.all %}
{% for lesson in child_group.lessons.all %}
<tr> <tr>
<th>{% trans 'No.' %}</th> <td>{{ child_group.name }}</td>
<th>{% trans 'Last name' %}</th> <td>{{ lesson.subject.name }}</td>
<th>{% trans 'First name' %}</th> <td>{{ lesson.teachers.all|join:', ' }}</td>
<th>{% trans 'Sex' %}</th> <td>{{ lesson.date_start }}</td>
<th>{% trans 'Date of birth' %}</th> <td>{{ lesson.date_end }}</td>
<th>{% trans 'Absences' %}</th> <td>{{ lesson.lesson_periods.count }}</td>
<th>{% trans 'Unexcused' %}</th>
<th>{% trans 'Tard.' %}</th>
</tr> </tr>
</thead> {% endfor %}
{% endfor %}
</tbody>
</table>
<div class="page-break">&nbsp;</div>
{% endif %}
<tbody> {% for person in persons %}
{% for person in persons %} <h4>{% trans 'Personal overview' %}: {{ person.last_name }}, {{ person.first_name }}</h4>
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ person.last_name }}</td>
<td>{{ person.first_name }}</td>
<td>{{ person.get_sex_display }}</td>
<td>{{ person.date_of_birth }}</td>
<td>{{ person.absences_count}}</td>
<td>{{ person.unexcused }}</td>
<td>{{ person.tardiness }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
<section class="sheet padding-10mm" id="lessons-overview"> <h5>{% blocktrans %}Contact details{% endblocktrans %}</h5>
<h2>{% trans 'Teachers and lessons in group' %} {{ group.name }}</h2> <table class="person-info">
<tr>
<td rowspan="6" class="person-img">
{% if person.photo %}
<img src="{% cropped_thumbnail person 'photo_cropping' max_size='300x400' %}"
alt="{{ person.first_name }} {{ person.last_name }}"/>
{% else %}
<img src="{% static 'img/fallback.png' %}" alt="{{ person.first_name }} {{ person.last_name }}"/>
{% endif %}
</td>
<td><i class="material-icons">person</i></td>
<td colspan="2">{{ person.first_name }} {{ person.additional_name }} {{ person.last_name }}</td>
</tr>
<tr>
<td><i class="material-icons">face</i></td>
<td colspan="2">{{ person.get_sex_display }}</td>
</tr>
<tr>
<td><i class="material-icons">home</i></td>
<td>{{ person.street }} {{ person.housenumber }}</td>
<td>{{ person.postal_code }} {{ person.place }}</td>
</tr>
<tr>
<td><i class="material-icons">phone</i></td>
<td>{{ person.phone_number }}</td>
<td>{{ person.mobile_number }}</td>
</tr>
<tr>
<td><i class="material-icons">email</i></td>
<td colspan="2">{{ person.email }}</td>
</tr>
<tr>
<td><i class="material-icons">cake</i></td>
<td colspan="2">{{ person.date_of_birth|date }}</td>
</tr>
</table>
<table id="lessons"> {% if personal_note_filters %}
<h5>{% trans 'Statistics on remarks' %}</h5>
<table>
<thead> <thead>
<tr> <tr>
<th>{% trans 'Subject' %}</th> <th>{% trans 'Description' %}</th>
<th>{% trans 'Teacher' %}</th> <th>{% trans 'Count' %}</th>
<th>{% trans 'Lesson start' %}</th> </tr>
<th>{% trans 'Lesson end' %}</th>
<th>{% trans 'Per week' %}</th>
</tr>
</thead> </thead>
<tbody> <tbody>
{% for lesson in group.lessons.all %} {% for note_filter in personal_note_filters %}
<tr> <tr>
<td>{{ lesson.subject.name }}</td> <td>{{ note_filter.description }}</td>
<td>{{ lesson.teachers.all|join:', ' }}</td> {% with "_personal_notes_with_"|add:note_filter.identifier as identifier %}
<td>{{ lesson.date_start }}</td> <td>{{ person|get_dict:identifier }}</td>
<td>{{ lesson.date_end }}</td> {% endwith %}
<td>{{ lesson.lesson_periods.count }}</td> </tr>
</tr> {% endfor %}
{% endfor %}
</tbody> </tbody>
</table> </table>
</section> {% endif %}
{% for person in persons %} <h5>{% trans 'Absences and tardiness' %}</h5>
<section class="sheet padding-10mm"> <table>
<h2>{% trans 'Personal overview' %}: {{ person.last_name }}, {{ person.first_name }}</h2> <thead>
<tr>
<th>{% trans 'Absences' %}</th>
<th>{% trans 'Unexcused' %}</th>
<th>{% trans 'Tardiness' %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ person.absences_count }}</td>
<td>{{ person.unexcused }}</td>
<td>{{ person.tardiness }}'</td>
</tr>
</tbody>
</table>
<h3>{% blocktrans %}Contact details{% endblocktrans %}</h3> <h5>{% trans 'Relevant personal notes' %}</h5>
<table class="person-info"> <table class="small-print">
<thead>
<tr>
<th>{% trans 'Date' %}</th>
<th>{% trans 'Pe.' %}</th>
<th>{% trans 'Subj.' %}</th>
<th>{% trans 'Te.' %}</th>
<th>{% trans 'Absent' %}</th>
<th>{% trans 'Tard.' %}</th>
<th>{% trans 'Remarks' %}</th>
</tr>
</thead>
<tbody>
{% for note in person.personal_notes.all %}
{% if note.absent or note.late or note.remarks %}
{% period_to_date note.week note.lesson_period.period as note_date %}
<tr> <tr>
<td rowspan="6" class="person-img"> <td>{{ note_date }}</td>
{% if person.photo %} <td>{{ note.lesson_period.period.period }}</td>
<img src="{% cropped_thumbnail person 'photo_cropping' max_size='300x400' %}" alt="{{ person.first_name }} {{ person.last_name }}" /> <td>{{ note.lesson_period.get_subject.short_name }} </td>
{% else %} <td>{{ note.lesson_period.get_teachers.first.short_name }}</td>
<img src="{% static 'img/fallback.png' %}" alt="{{ person.first_name }} {{ person.last_name }}" /> <td>
{% if note.absent %}
{% trans 'Yes' %}
{% if note.escused %}
({% trans 'e' %})
{% endif %}
{% endif %} {% endif %}
</td> </td>
<td><i class="material-icons">person</i></td> <td>
<td>{{ person.first_name }}</td> {% if note.late %}
<td>{{ person.additional_name }}</td> {{ note.late }}'
<td>{{ person.last_name }}</td> {% endif %}
</tr> </td>
<tr> <td>{{ note.remarks }}</td>
<td><i class="material-icons">face</i></td>
<td colspan="3">{{ person.get_sex_display }}</td>
</tr>
<tr>
<td><i class="material-icons">home</i></td>
<td colspan="2">{{ person.street }} {{ person.housenumber }}</td>
<td colspan="2">{{ person.postal_code }} {{ person.place }}</td>
</tr>
<tr>
<td><i class="material-icons">phone</i></td>
<td>{{ person.phone_number }}</td>
<td>{{ person.mobile_number }}</td>
</tr>
<tr>
<td><i class="material-icons">email</i></td>
<td colspan="3">{{ person.email }}</td>
</tr>
<tr>
<td><i class="material-icons">gift</i></td>
<td colspan="3">{{ person.date_of_birth|date }}</td>
</tr> </tr>
{% comment %}
<tr>
<td><i class="material-icons">school</i></td>
<td>Class</td>
<td>Teacher</td>
</tr>
{% endcomment %}
</table>
{% if personal_note_filters %}
<h3>{% trans 'Statistics on remarks' %}</h3>
<table>
<thead>
<tr>
<th>{% trans 'Description' %}</th>
<th>{% trans 'Count' %}</th>
</tr>
</thead>
<tbody>
{% for note_filter in personal_note_filters %}
<tr>
<td>{{ note_filter.description }}</td>
{% with "_personal_notes_with_"|add:note_filter.identifier as identifier %}
<td>{{ person|get_dict:identifier }}</td>
{% endwith %}
</tr>
{% endfor %}
</rbody>
</table>
{% endif %} {% endif %}
{% endfor %}
</tbody>
</table>
<h3>{% trans 'Absences and tardiness' %}</h3> <div class="page-break">&nbsp;</div>
<table>
<thead>
<tr>
<th>{% trans 'Absences' %}</th>
<th>{% trans 'Unexcused' %}</th>
<th>{% trans 'Tardiness' %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ person.absences_count }}</td>
<td>{{ person.unexcused }}</td>
<td>{{ person.tardiness }}</td>
</tr>
</tbody>
</table>
<h3>{% trans 'Relevant personal notes' %}</h3>
<table>
<thead>
<tr>
<th>{% trans 'Date' %}</th>
<th>{% trans 'Pe.' %}</th>
<th>{% trans 'Subj.' %}</th>
<th>{% trans 'Te.' %}</th>
<th>{% trans 'Absent' %}</th>
<th>{% trans 'Tard.' %}</th>
<th>{% trans 'Remarks' %}</th>
</tr>
</thead>
<tbody> {% endfor %}
{% for note in person.personal_notes.all %}
{% if note.absent or note.late or note.remarks %}
{% period_to_date note.week note.lesson_period.period as note_date %}
<tr>
<td>{{ note_date }}</td>
<td>{{ note.lesson_period.period.period }}</td>
<td>{{ note.lesson_period.get_subject.short_name }} </td>
<td>{{ note.lesson_period.get_teachers.first.short_name }}</td>
<td>
{% if note.absent %}
{% trans 'Yes' %}
{% if note.escused %}
({% trans 'e' %})
{% endif %}
{% endif %}
</td>
<td>
{% if note.late %}
{{ note.late }}
{% endif %}
</td>
<td>{{ note.remarks }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</section>
{% endfor %}
{% for week in weeks %} {% for week in weeks %}
<section class="sheet padding-10mm smallprint"> <h4>{% trans 'Lesson documentation for week' %} {{ week.week }}</h4>
<h2>{% trans 'Lesson documentation for calendar week' %} {{ week.week }}</h2>
<table> <table class="small-print">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>{% trans 'Pe.' %}</th> <th>{% trans 'Pe.' %}</th>
<th>{% trans 'Subj.' %}</th> <th>{% trans 'Subj.' %}</th>
<th>{% trans 'Subs.' %}</th> <th>{% trans 'Lesson topic' %}</th>
<th>{% trans 'Lesson topic' %}</th> <th>{% trans 'Homework' %}</th>
<th>{% trans 'Homework' %}</th> <th>{% trans 'Notes' %}</th>
<th>{% trans 'Notes' %}</th> <th>{% trans 'Te.' %}</th>
<th>{% trans 'Te.' %}</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> {% for day in week %}
{% for day in week %} {% with periods_by_day|get_dict:day as periods %}
{% with periods_by_day|get_dict:day as periods %} {% for period, documentations, notes, substitution in periods %}
{% for period, documentations, notes, substitution in periods %} <tr class="
<tr class="
{% if substitution %} {% if substitution %}
{% if substitution.cancelled %} {% if substitution.cancelled %}
lesson-cancelled lesson-cancelled
...@@ -291,55 +322,62 @@ ...@@ -291,55 +322,62 @@
lessons-day-first lessons-day-first
{% endif %} {% endif %}
"> ">
{% if forloop.first %} {% if forloop.first %}
<th rowspan="{{ periods|length }}" class="lessons-day-head">{{ day }}</th> <th rowspan="{{ periods|length }}" class="lessons-day-head">{{ day }}</th>
{% endif %} {% endif %}
<td class="lesson-pe">{{ period.period.period }}</td> <td class="lesson-pe">{{ period.period.period }}</td>
<td class="lesson-subj">{{ period.lesson.subject.short_name }}</td> <td class="lesson-subj">
<td class="lesson-subs">{{ substitution.subject.short_name }}</td> {% if substitution %}
<td class="lesson-topic"> {% include "chronos/partials/subs/subject.html" with type="substitution" el=substitution %}
{% if substitution.cancelled %} {% else %}
{% trans 'Lesson cancelled' %} {% include "chronos/partials/subject.html" with subject=period.lesson.subject %}
{% else %} {% endif %}
{{ documentations.0.topic }} </td>
{% endif %} <td class="lesson-topic">
</td> {% if substitution.cancelled %}
<td class="lesson-homework">{{ documentations.0.homework }}</td> {% trans 'Lesson cancelled' %}
<td class="lesson-notes"> {% else %}
{% for note in notes %} {{ documentations.0.topic }}
{% if note.absent %} {% endif %}
<span class="lesson-note-absent"> </td>
{{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. <td class="lesson-homework">{{ documentations.0.homework }}</td>
{% if note.excused %} <td class="lesson-notes">
<span class="lesson-note-excused"> {% for note in notes %}
{% if note.absent %}
<span class="lesson-note-absent">
{{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}.
{% if note.excused %}
<span class="lesson-note-excused">
({% trans 'e' %}) ({% trans 'e' %})
</span> </span>
{% endif %} {% endif %}
{% endif %} </span>
{% if note.late %} {% endif %}
<span class="lesson-note-late"> {% if note.late %}
{{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. <span class="lesson-note-late">
({{ note.late }}′) {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}.
{% if note.excused %} ({{ note.late }}′)
<span class="lesson-note-excused"> {% if note.excused %}
<span class="lesson-note-excused">
({% trans 'e' %}) ({% trans 'e' %})
</span> </span>
{% endif %}
{% endif %}
{% endfor %}
</td>
<td class="lesson-te">
{% if documentations.0.topic %}
{{ substitution.teachers.first.short_name|default:period.lesson.teachers.first.short_name }}
{% endif %} {% endif %}
</td> </span>
</tr> {% endif %}
{% endfor %} {% endfor %}
{% endwith %} </td>
{% endfor %} <td class="lesson-te">
</tbody> {% if documentations.0.topic %}
</table> {{ substitution.teachers.first.short_name|default:period.lesson.teachers.first.short_name }}
</section> {% endif %}
{% endfor %} </td>
</body> </tr>
</html> {% endfor %}
{% endwith %}
{% endfor %}
</tbody>
</table>
<div class="page-break">&nbsp;</div>
{% endfor %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment