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

Update substitutions print templates for calendar

parent 7f59fc60
No related branches found
No related tags found
1 merge request!315Resolve "Substitutions PDF for new data model"
Showing
with 45 additions and 62 deletions
<a href="{% url "timetable" "group" item.pk %}">
{{ item.short_name }}{% if not forloop.last %},{% endif %}
</a>
{{ item.short_name }}{% if not forloop.last %},{% endif %}
{% if groups.count == 1 and groups.0.parent_groups.all and request.site.preferences.chronos__use_parent_groups %}
{% include "chronos/partials/groups_part.html" with groups=groups.0.parent_groups.all no_collapsible=no_collapsible %}
{% include "chronos/partials/groups_part.html" with groups=groups.0.parent_groups.all %}
{% else %}
{% include "chronos/partials/groups_part.html" with groups=groups no_collapsible=no_collapsible %}
{% endif %}
{% if groups.count > request.site.preferences.chronos__shorten_groups_limit and request.user.person.preferences.chronos__shorten_groups and not no_collapsible %}
{% include "components/text_collapsible.html" with template="chronos/partials/group.html" qs=groups %}
{% else %}
{% for group in groups %}
{% include "chronos/partials/group.html" with item=group %}
{% endfor %}
{% endif %}
{% for group in groups %}
{% include "chronos/partials/group.html" with item=group %}
{% endfor %}
{% load i18n %}
{% if affected_teachers or affected_groups or absent_teachers or absent_groups %}
<div class="{% if not print %}card{% endif %}">
<div class="{% if not print %}card-content{% endif %}">
<div>
<div>
{% if absent_teachers %}
<div class="row no-margin">
<div class="col {% if not print %}s12 m3{% else %}s3{% endif %}">
<div class="col">
<strong class="truncate">
{% trans "Absent teachers" %}
</strong>
</div>
<div class="col {% if not print %}s12 m9{% else %}s9{% endif %} black-text-a">
<div class="col">
{% include "chronos/partials/teachers.html" with teachers=absent_teachers %}
</div>
</div>
{% endif %}
{% if absent_groups %}
<div class="row no-margin">
<div class="col {% if not print %}s12 m3{% else %}s3{% endif %}">
<div class="col">
<strong class="truncate">
{% trans "Absent groups" %}
</strong>
</div>
<div class="col {% if not print %}s12 m9{% else %}s9{% endif %} black-text-a">
<div class="col">
{% include "chronos/partials/groups.html" with groups=absent_groups no_collapsible=True %}
</div>
</div>
{% endif %}
{% if affected_teachers %}
<div class="row no-margin">
<div class="col {% if not print %}s12 m3{% else %}s3{% endif %}">
<div class="col">
<strong class="truncate">
{% trans "Affected teachers" %}
</strong>
</div>
<div class="col {% if not print %}s12 m9{% else %}s9{% endif %} black-text-a">
<div class="col">
{% include "chronos/partials/teachers.html" with teachers=affected_teachers %}
</div>
</div>
{% endif %}
{% if affected_groups %}
<div class="row no-margin">
<div class="col {% if not print %}s12 m3{% else %}s3{% endif %}">
<div class="col">
<strong class="truncate">
{% trans "Affected groups" %}
</strong>
</div>
<div class="col {% if not print %}s12 m9{% else %}s9{% endif %} black-text-a">
{% include "chronos/partials/groups.html" with groups=affected_groups no_collapsible=True %}
<div class="col">
{% include "chronos/partials/groups.html" with groups=affected_groups %}
</div>
</div>
{% endif %}
......
{% for room in rooms %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ room }}">
<a href="{% url "timetable" "room" room.pk %}">
{{ room.short_name }}{% if not forloop.last %},{% endif %}
</a>
</span>
{{ room.short_name|default:room.name }}{% if not forloop.last %},{% endif %}
{% endfor %}
<strong>
<span data-position="bottom" class="tooltipped" data-tooltip="{{ subject.name }}">{{ subject.short_name }}</span>
{{ subject.short_name|default:subject.name }}
</strong>
{% load i18n %}
{% if sub.cancelled %}
{% if el.cancelled %}
<span class="badge new green">{% trans "Cancelled" %}</span>
{% endif %}
{% if item.el.cancelled %}
{% if el.cancelled %}
green-text
{% else %}
black-text
......
{% load i18n %}
<strong>
{% if el.datetime_start %}
{{ el.datetime_start.time }} - {{ el.datetime_end.time }}
{% elif el.date_start %}
{{ el.date_start }} - {{ el.date_end }}
{% if el.REFERENCE_OBJECT.slot_number_start and el.REFERENCE_OBJECT.slot_number_end %}
{% if el.REFERENCE_OBJECT.slot_number_start == el.REFERENCE_OBJECT.slot_number_end %}
{{ el.REFERENCE_OBJECT.slot_number_start }}.
{% else %}
{{ el.REFERENCE_OBJECT.slot_number_start }}.–{{ el.REFERENCE_OBJECT.slot_number_end }}.
{% endif %}
{% elif el.DTSTART.dt.time %}
{{ el.DTSTART.dt.time }} - {{ el.DTSTART.dt.time }}
{% else %}
{% trans "all day" %}
{% endif %}
</strong>
......@@ -2,25 +2,17 @@
{% if not el.amends.subject and not el.subject %}
{% if el.amends.title %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.amends.title }}">
<s>{{ el.amends.title }}</s>
{% endif %}
{% if el.title %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.title }}">
<s>{{ el.title }}</s>
{% endif %}
{% elif el.cancelled %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.subject.short_name }}">
<s>{{ el.subject.short_name }}</s>
</span>
<s>{% include "chronos/partials/subject.html" with subject=el.amends.subject %}</s>
{% elif el.subject and el.amends.subject %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.amends.subject.name }}">
<s>{{ el.amends.subject.short_name }}</s>
</span>
<s>{% include "chronos/partials/subject.html" with subject=el.amends.subject %}</s>
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.subject.name }}">
<strong>{{ el.subject.short_name }}</strong>
</span>
<strong>{% include "chronos/partials/subject.html" with subject=el.subject %}</strong>
{% elif el.subject and not el.amends.subject %}
{% include "chronos/partials/subject.html" with subject=el.subject %}
{% else %}
......
{% for teacher in teachers %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ teacher }}">
<a href="{% url "timetable" "teacher" teacher.pk %}">
{{ teacher.short_name }}{% if not forloop.last %},{% endif %}
</a>
</span>
{{ teacher.short_name|default:teacher.full_name }}{% if not forloop.last %},{% endif %}
{% endfor %}
......@@ -18,7 +18,7 @@
{% include "core/partials/announcements.html" with announcements=c.announcements show_recipients=1 %}
{% include "chronos/partials/headerbox.html" with absent_teachers=c.absent_teachers absent_groups=c.absent_groups print=1 %}
{% include "chronos/partials/headerbox.html" with absent_teachers=c.absent_teachers absent_groups=c.absent_groups affected_teachers=c.affected_teachers affected_groups=c.affected_groups %}
<table class="substitutions">
<thead>
......@@ -47,30 +47,30 @@
<tbody>
{% for item in c.substitutions %}
{% ifchanged item.el.group_names %}
{% ifchanged item.el.REFERENCE_OBJECT.group_names %}
</tbody>
<tbody class="{% cycle "striped" "not-striped" %}">
{% endifchanged %}
<tr class="{% include "chronos/partials/subs/colour.html" with item=item %}">
<tr class="{% include "chronos/partials/subs/colour.html" with el=item.el.REFERENCE_OBJECT %}">
<td>
{% include "chronos/partials/subs/groups.html" with type=item.type el=item.el %}
{% include "chronos/partials/subs/groups.html" with el=item.el.REFERENCE_OBJECT %}
</td>
<td>
{% include "chronos/partials/subs/period.html" with type=item.type el=item.el item=item %}
{% include "chronos/partials/subs/period.html" with el=item.el %}
</td>
<td>
{% include "chronos/partials/subs/teachers.html" with type=item.type el=item.el %}
{% include "chronos/partials/subs/teachers.html" with el=item.el.REFERENCE_OBJECT %}
</td>
<td>
{% include "chronos/partials/subs/subject.html" with type=item.type el=item.el %}
{% include "chronos/partials/subs/subject.html" with el=item.el.REFERENCE_OBJECT %}
</td>
<td>
{% include "chronos/partials/subs/rooms.html" with type=item.type el=item.el %}
{% include "chronos/partials/subs/rooms.html" with el=item.el.REFERENCE_OBJECT %}
</td>
<td>
{% include "chronos/partials/subs/badge.html" with sub=item.el %}
{% include "chronos/partials/subs/comment.html" with el=item.el %}
{% include "chronos/partials/subs/badge.html" with el=item.el.REFERENCE_OBJECT %}
{% include "chronos/partials/subs/comment.html" with el=item.el.REFERENCE_OBJECT %}
</td>
</tr>
{% endfor %}
......
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