Skip to content
Snippets Groups Projects
Verified Commit 6833571a authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch 'master' of edugit.org:AlekSIS/official/AlekSIS-App-Chronos

parents baed37bc 0bb23519
No related branches found
No related tags found
No related merge requests found
Showing
with 923 additions and 222 deletions
......@@ -16,11 +16,11 @@ Licence
::
Copyright © 2018, 2019 Frank Poetzsch-Heffter <p-h@katharineum.de>
Copyright © 2018, 2019, 2020 Jonathan Weth <wethjo@katharineum.de>
Copyright © 2018, 2019 Frank Poetzsch-Heffter <p-h@katharineum.de>
Copyright © 2019, 2020 Dominik George <dominik.george@teckids.org>
Copyright © 2019 Hangzhi Yu <yuha@katharineum.de>
Copyright © 2019 Tom Teichler <tom.teichler@teckids.org>
Copyright © 2019 Hangzhi Yu <yuha@katharineum.de>
Licenced under the EUPL, version 1.2 or later
......
from django.contrib import admin
from django.utils.html import format_html
from .models import TimetableWidget
from .models import (
TimetableWidget,
Lesson,
LessonSubstitution,
SupervisionSubstitution,
LessonPeriod,
Absence,
Event,
Holiday,
Supervision,
Subject,
SupervisionArea,
Room,
AbsenceReason,
Break,
TimePeriod,
)
from .util.format import format_date_period, format_m2m
admin.site.register(TimetableWidget)
def colour_badge(fg: str, bg: str, val: str):
html = """
<div style="
color: {};
background-color: {};
padding-top: 3px;
padding-bottom: 4px;
text-align: center;
border-radius: 3px;
">{}</span>
"""
return format_html(html, fg, bg, val)
class AbsenceReasonAdmin(admin.ModelAdmin):
list_display = ("short_name", "name")
list_display_links = ("short_name", "name")
admin.site.register(AbsenceReason, AbsenceReasonAdmin)
class AbsenceAdmin(admin.ModelAdmin):
def start(self, obj):
return format_date_period(obj.date_start, obj.period_from)
def end(self, obj):
return format_date_period(obj.date_end, obj.period_to)
list_display = ("__str__", "reason", "start", "end")
admin.site.register(Absence, AbsenceAdmin)
class SupervisionInline(admin.TabularInline):
model = Supervision
class BreakAdmin(admin.ModelAdmin):
list_display = ("__str__", "after_period", "before_period")
inlines = [SupervisionInline]
admin.site.register(Break, BreakAdmin)
class EventAdmin(admin.ModelAdmin):
def start(self, obj):
return format_date_period(obj.date_start, obj.period_from)
def end(self, obj):
return format_date_period(obj.date_end, obj.period_to)
def _groups(self, obj):
return format_m2m(obj.groups)
def _teachers(self, obj):
return format_m2m(obj.teachers)
def _rooms(self, obj):
return format_m2m(obj.rooms)
filter_horizontal = ("groups", "teachers", "rooms")
list_display = ("__str__", "_groups", "_teachers", "_rooms", "start", "end")
admin.site.register(Event, EventAdmin)
class HolidayAdmin(admin.ModelAdmin):
list_display = ("title", "date_start", "date_end")
admin.site.register(Holiday, HolidayAdmin)
class LessonPeriodInline(admin.TabularInline):
model = LessonPeriod
class LessonSubstitutionAdmin(admin.ModelAdmin):
list_display = ("lesson_period", "week", "date")
list_display_links = ("lesson_period", "week", "date")
filter_horizontal = ("teachers",)
admin.site.register(LessonSubstitution, LessonSubstitutionAdmin)
class LessonAdmin(admin.ModelAdmin):
def _groups(self, obj):
return format_m2m(obj.groups)
def _teachers(self, obj):
return format_m2m(obj.teachers)
filter_horizontal = ["teachers", "groups"]
inlines = [LessonPeriodInline]
list_filter = ("subject", "groups", "groups__parent_groups", "teachers")
list_display = ("_groups", "subject", "_teachers")
admin.site.register(Lesson, LessonAdmin)
class RoomAdmin(admin.ModelAdmin):
list_display = ("short_name", "name")
list_display_links = ("short_name", "name")
admin.site.register(Room, RoomAdmin)
class SubjectAdmin(admin.ModelAdmin):
def _colour(self, obj):
return colour_badge(obj.colour_fg, obj.colour_bg, obj.abbrev,)
list_display = ("abbrev", "name", "_colour")
list_display_links = ("abbrev", "name")
admin.site.register(Subject, SubjectAdmin)
class SupervisionAreaAdmin(admin.ModelAdmin):
def _colour(self, obj):
return colour_badge(obj.colour_fg, obj.colour_bg, obj.short_name,)
list_display = ("short_name", "name", "_colour")
list_display_links = ("short_name", "name")
inlines = [SupervisionInline]
admin.site.register(SupervisionArea, SupervisionAreaAdmin)
class SupervisionSubstitutionAdmin(admin.ModelAdmin):
list_display = ("supervision", "date")
admin.site.register(SupervisionSubstitution, SupervisionSubstitutionAdmin)
class SupervisionAdmin(admin.ModelAdmin):
list_display = ("break_item", "area", "teacher")
admin.site.register(Supervision, SupervisionAdmin)
class TimePeriodAdmin(admin.ModelAdmin):
list_display = ("weekday", "period", "time_start", "time_end")
list_display_links = ("weekday", "period")
admin.site.register(TimePeriod, TimePeriodAdmin)
class TimetableWidgetAdmin(admin.ModelAdmin):
list_display = ("title", "active")
admin.site.register(TimetableWidget, TimetableWidgetAdmin)
......@@ -3,4 +3,16 @@ from aleksis.core.util.apps import AppConfig
class ChronosConfig(AppConfig):
name = "aleksis.apps.chronos"
verbose_name = "AlekSIS - Chronos (Timetables)"
verbose_name = "AlekSIS — Chronos (Timetables)"
urls = {
"Repository": "https://edugit.org/AlekSIS/official/AlekSIS-App-Chronos/",
}
licence = "EUPL-1.2+"
copyright = (
([2018, 2019, 2020], "Jonathan Weth", "wethjo@katharineum.de"),
([2018, 2019], "Frank Poetzsch-Heffter", "p-h@katharineum.de"),
([2019, 2020], "Dominik George", "dominik.george@teckids.org"),
([2019], "Tom Teichler", "tom.teichler@teckids.org"),
([2019], "Hangzhi Yu", "yuha@katharineum.de"),
)
# Generated by Django 3.0.5 on 2020-04-13 13:36
from django.db import migrations, models
from django.db.models import F
class Migration(migrations.Migration):
dependencies = [
('chronos', '0009_extended_data'),
]
operations = [
migrations.AddField(
model_name='absencereason',
name='name',
field=models.CharField(default=F("description"), blank=True, max_length=255, null=True, verbose_name='Name'),
),
migrations.AddField(
model_name='absencereason',
name='short_name',
field=models.CharField(default=F("title"), max_length=255, verbose_name='Short name'),
preserve_default=False,
),
migrations.RemoveField(
model_name='absencereason',
name='description',
),
migrations.RemoveField(
model_name='absencereason',
name='title',
),
]
# Generated by Django 3.0.5 on 2020-04-13 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('chronos', '0010_absence_reason_name'),
]
operations = [
migrations.RemoveField(
model_name='absence',
name='person',
),
migrations.AddField(
model_name='absence',
name='group',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='absences', to='core.Group'),
),
migrations.AddField(
model_name='absence',
name='room',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='absences', to='chronos.Room'),
),
migrations.AddField(
model_name='absence',
name='teacher',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='absences', to='core.Person'),
),
]
# Generated by Django 3.0.5 on 2020-04-13 16:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chronos', '0011_absence_for_groups_and_rooms'),
]
operations = [
migrations.RemoveField(
model_name='event',
name='absence_reason',
),
]
# Generated by Django 3.0.5 on 2020-04-14 16:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chronos', '0012_event_remove_absence_reason'),
]
operations = [
migrations.AlterField(
model_name='event',
name='title',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Title'),
),
]
This diff is collapsed.
......@@ -26,6 +26,10 @@ li.active > a > .sidenav-badge {
min-height: 65px;
}
.supervision-card {
min-height: 35px;
}
.lesson-card .card-content {
padding: 0;
text-align: center;
......@@ -53,6 +57,8 @@ li.active > a > .sidenav-badge {
.timetable-mobile-title-card {
margin-top: 50px;
margin-bottom: .60rem;
display: flex;
flex-grow: 1;
}
.timetable-mobile-title-card:first-child {
......@@ -112,3 +118,23 @@ table.substitutions td, table.substitutions th {
.black-text-a a {
color: black;
}
.holiday-badge {
float: left !important;
position: relative;
margin-left: 0 !important;
left: 50%;
transform: translate(-50%);
width: auto;
height: auto !important;
min-height: 26px;
margin-top: 5px;
}
.holiday-card .card-content{
width: 100%;
}
.holiday-card .holiday-badge {
margin-top: 0;
}
<div class="card lesson-card">
<div class="card-content">
{% for element in elements %}
{% if element.label_ == "lesson_period" %}
{% include "chronos/partials/lesson.html" with lesson_period=element %}
{% elif element.label_ == "event" %}
{% include "chronos/partials/event.html" with event=element %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="lesson-with-event">
<p>
{# Teacher or room > Display groups #}
{% if type == "teacher" or type == "room" %}
{% include "chronos/partials/groups.html" with groups=event.groups.all %}
{% endif %}
{# Class or room > Display teachers #}
{% if type == "room" or type == "group" %}
{% include "chronos/partials/teachers.html" with teachers=event.teachers.all %}
{% endif %}
{# Teacher or class > Display rooms #}
{% if type == "teacher" or type == "group" %}
{% for room in event.rooms.all %}
<span class="tooltipped" data-position="bottom" data-tooltip="{{ room.name }}">
<a href="{% url "timetable" "room" room.pk %}">
{{ room.short_name }}
</a>
</span>
{% endfor %}
{% endif %}
{% if type == "teacher" and not event.groups.all and not event.rooms.all and event.title %}
<em>{{ event.title }}</em>
{% elif type == "group" and not event.teachers.all and not event.groups.all and event.title %}
<em>{{ event.title }}</em>
{% elif type == "room" and not event.teachers.all and not event.groups.all and event.title %}
<em>{{ event.title }}</em>
{% elif event.title %}
<br/>
<small>
<em>{{ event.title }}</em>
</small>
{% endif %}
</p>
</div>
{% load i18n %}
{% if affected_teachers and affected_groups %}
{% 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 %}">
{% if absent_teachers %}
<div class="row no-margin">
<div class="col s12 m3">
<strong class="truncate">
{% trans "Absent teachers" %}
</strong>
</div>
<div class="col s12 m9 black-text-a">
{% include "chronos/partials/teachers.html" with teachers=absent_teachers %}
</div>
</div>
{% endif %}
{% if absent_groups %}
<div class="row no-margin">
<div class="col s12 m3">
<strong class="truncate">
{% trans "Absent groups" %}
</strong>
</div>
<div class="col s12 m9 black-text-a">
{% include "chronos/partials/groups.html" with groups=absent_groups %}
</div>
</div>
{% endif %}
{% if affected_teachers %}
<div class="row no-margin">
<div class="col s12 m3">
......
<span class="badge new blue center-align holiday-badge">{{ holiday.title }}</span>
{% load i18n %}
<div class="card lesson-card">
<div class="card-content">
{# Every element of the lesson #}
{% for lesson_period in lessons %}
<div style="
{# Display background color only if no badge exists and it is not the old room and there are no holidays #}
{% if not lesson_period.get_substitution.cancelled and not lesson_period.is_hol %}
{% if not lesson_period.room != lesson_period.get_room or type != 1 %}
{% if lesson_period.lesson.subject.colour_fg %}
color: {{ lesson_period.lesson.subject.colour_fg }};
{% endif %}
{% if lesson_period.lesson.subject.colour_bg %}
background-color: {{ lesson_period.lesson.subject.colour_bg }};
{% endif %}
{% endif %}
{% endif %}
"
{# Add CSS class for sub when it's a sub #}
class="{% if lesson_period.get_substitution and smart %}{% if lesson_period.substitution.table.is_event %}lesson-with-event{% else %}lesson-with-sub{% endif %}{% endif %}"
>
<p>
{% if lesson_period.is_hol and smart %}
{# Do nothing #}
{% elif lesson_period.get_substitution and smart %}
{% with sub=lesson_period.get_substitution %}
{# SUBSTITUTION #}
{% if type == "room" and lesson_period.room != lesson_period.get_room %}
{# When it's the old room, let it empty #}
{% elif lesson_period.get_substitution.cancelled %}
{# When a badge (cancellation, etc.) exists, then display it with the teacher#}
{# Class or room > Display teacher #}
{% if type == "group" or type == "room" and lesson_period.lesson.teachers.all %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}<br/>
{% endif %}
{# Badge #}
<span class="badge new green darken-2">{% trans "Cancelled" %}</span>
{% else %}
{# Display sub #}
{# Teacher or room > display classes #}
{% if type == "teacher" or type == "room" %}
{% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %}
{% endif %}
{# Display teacher with tooltip #}
{% include "chronos/partials/subs/teachers.html" %}
{# Display subject #}
{% include "chronos/partials/subs/subject.html" %}
{# Teacher or class > display room #}
{% if type == "teacher" or type == "group" %}
{% include "chronos/partials/subs/room.html" %}
{% endif %}
{% endif %}
{# When it isn't a room or the old plan, then display the extra text (e. g. work orders) AND NOT A EVENT#}
{% if not lesson_period.substitution.table.is_event %}
{% if not type == "room" or not lesson_period.is_old %}
<br>
<small>
<em>{{ lesson_period.substitution.table.text|default:"" }}</em>
</small>
{% endif %}
{% endif %}
{# Display the extra text for events #}
{% if lesson_period.substitution.table.is_event %}
{% if type == 0 and lesson_period.substitution.table.classes == "" and lesson_period.substitution.table.rooms|length == 0 and lesson_period.substitutions.table.teachers|length == 0 %}
<em>{{ lesson_period.substitution.table.text|default:"" }}</em>
{% elif type == 2 and lesson_period.substitution.table.teachers|length == 0 and lesson_period.substitution.table.rooms|length == 0 %}
<em>{{ lesson_period.substitution.table.text|default:"" }}</em>
{% elif type == 1 and lesson_period.substitution.table.teachers|length == 0 and lesson_period.substitution.table.classes == "" %}
<em>{{ lesson_period.substitution.table.text|default:"" }}</em>
{% else %}
<br>
<small>
<em>{{ lesson_period.substitution.table.text|default:"" }}</em>
</small>
{% endif %}
{% endif %}
{% endwith %}
{% else %}
{# Normal plan #}
{# Teacher or room > Display classes #}
{% if type == "teacher" or type == "room" %}
{# {{ element_container.element.classes }}#}
{% if lesson_period.lesson.groups %}
{% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %}
{% endif %}
<div style="
{# Display background color only if no badge exists and it is not the old room and there are no holidays #}
{% if not lesson_period.get_substitution.cancelled and not lesson_period.get_substitution.cancelled_for_teachers %}
{% if not type == "room" or lesson_period.room == lesson_period.get_room or lesson_period.get_room == el %}
{% if lesson_period.lesson.subject.colour_fg %}
color: {{ lesson_period.lesson.subject.colour_fg }};
{% endif %}
{# Class or room > Display teacher #}
{% if type == "room" or type == "group" %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}
{% if lesson_period.lesson.subject.colour_bg %}
background-color: {{ lesson_period.lesson.subject.colour_bg }};
{% endif %}
{% endif %}
{% endif %}
"
{# Add CSS class for sub when it's a sub #}
class="{% if lesson_period.get_substitution and smart %}lesson-with-sub{% endif %}"
>
<p>
{% if lesson_period.is_hol and smart %}
{# Do nothing #}
{% elif lesson_period.get_substitution and smart %}
{% with sub=lesson_period.get_substitution %}
{# SUBSTITUTION #}
{% if type == "room" and lesson_period.room != lesson_period.get_room and lesson_period.get_room != el %}
{# When it's the old room, let it empty #}
{% elif sub.cancelled or sub.cancelled_for_teachers %}
{# When a badge (cancellation, etc.) exists, then display it with the teacher#}
{# Class or room > Display teacher #}
{% if type == "group" or type == "room" and lesson_period.lesson.teachers.all %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}<br/>
{% endif %}
{# Badge #}
{% include "chronos/partials/subs/badge.html" with sub=sub %}
{% else %}
{# Display sub #}
{# Teacher or room > display classes #}
{% if type == "teacher" or type == "room" %}
{% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %}
{% endif %}
{# Display teacher with tooltip #}
{% include "chronos/partials/subs/teachers.html" with type="substitution" el=sub %}
{# Display subject #}
{% include "chronos/partials/subs/subject.html" with type="substitution" el=sub %}
{# Teacher or class > display room #}
{% if type == "teacher" or type == "group" %}
{% include "chronos/partials/subs/room.html" with type="substitution" el=sub %}
{% endif %}
{% endif %}
{# When it isn't a room or the old plan, then display the extra text (e. g. work orders) #}
{% if not lesson_period.room == lesson_period.get_room and lesson_period.get_room != el and sub.comment %}
<br>
<small>
<em>{{ lesson_period.get_substitution.comment }}</em>
</small>
{% endif %}
{% endwith %}
{% else %}
{# Normal plan #}
{# Display subject #}
<strong>
{# Teacher or room > Display classes #}
{% if type == "teacher" or type == "room" %}
{# {{ element_container.element.classes }}#}
{% if lesson_period.lesson.groups %}
{% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %}
{% endif %}
{% endif %}
{# Class or room > Display teacher #}
{% if type == "room" or type == "group" %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}
{% endif %}
{# Display subject #}
<strong>
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ lesson_period.lesson.subject.name }}">{{ lesson_period.lesson.subject.abbrev }}</span>
</strong>
</strong>
{# Teacher or class > Display room #}
{% if type == "teacher" or type == "group" %}
{% if lesson_period.room %}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ lesson_period.room.name }}">
{# Teacher or class > Display room #}
{% if type == "teacher" or type == "group" %}
{% if lesson_period.room %}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ lesson_period.room.name }}">
<a href="{% url "timetable" "room" lesson_period.room.pk %}">
{{ lesson_period.room.short_name }}
</a>
</span>
{% endif %}
{% endif %}
{% endif %}
</p>
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endif %}
</p>
</div>
{% for period, lessons in lesson_periods.items %}
{% if holiday %}
<div class="row">
<div class="col s4">
{% include "chronos/partials/period_time.html" with period=period periods=periods %}
</div>
<div class="col s8">
{% include "chronos/partials/lesson.html" with lessons=lessons %}
<div class="col s12">
<div class="card col s12 holiday-card">
<div class="card-content">
<p>
{% include "chronos/partials/holiday.html" with holiday=holiday %}<br/>
</p>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
{% for row in timetable %}
<div class="row">
<div class="col s4">
{% if row.type == "period" %}
{% include "chronos/partials/period_time.html" with period=row.period periods=periods %}
{% endif %}
</div>
<div class="col s8">
{% if row.type == "period" %}
{% include "chronos/partials/elements.html" with elements=row.col %}
{% else %}
{% include "chronos/partials/supervision.html" with supervision=row.col %}
{% endif %}
</div>
</div>
{% endfor %}
{% endif %}
{% load i18n %}
{% if sub.cancelled %}
<span class="badge new green">{% trans "Cancelled" %}</span>
{% elif item.el.cancelled_for_teachers %}
<span class="badge new green">{% trans "Cancelled for teachers" %}</span>
{% endif %}
{% if item.type == "substitution" %}
{% if item.el.cancelled or item.el.cancelled_for_teachers %}
green-text
{% else %}
black-text
{% endif %}
{% elif item.type == "supervision_substitution" %}
blue-text
{% endif %}
<strong>
{% if type == "substitution" %}
{{ el.lesson_period.period.period }}.
{% elif type == "supervision_substitution" %}
{% with break=el.supervision.break_item %}
{{ break.after_period_number }}./{{ break.before_period_number }}.
{% endwith %}
{% endif %}
</strong>
{% if not sub.is_event %}
{% if sub.sub.type == 3 %}
{# Supervisement #}
{{ sub.sub.corridor.name }}
{% elif sub.sub.type == 1 or sub.sub.type == 2 %}
{% if type == "substitution" %}
{% if el.cancelled or el.cancelled_for_teachers %}
{# Canceled lesson: no room #}
{% elif sub.room and sub.lesson_period.room %}
{% elif el.room and el.lesson_period.room %}
{# New and old room available #}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ sub.lesson_period.room.name }} → {{ sub.lesson_period.room.name }}">
<a href="{% url "timetable" "room" sub.lesson_period.room.pk %}">
<s>{{ sub.lesson_period.room.short_name }}</s>
</a>
<a href="{% url "timetable" "room" sub.room.pk %}">
<strong>{{ sub.room.short_name }}</strong>
</a>
</span>
{% elif sub.room and not sub.lesson_period.room %}
data-tooltip="{{ el.lesson_period.room.name }} → {{ el.lesson_period.room.name }}"
title="{{ el.lesson_period.room.name }} → {{ el.lesson_period.room.name }}">
<a href="{% url "timetable" "room" el.lesson_period.room.pk %}">
<s>{{ el.lesson_period.room.short_name }}</s>
</a>
<a href="{% url "timetable" "room" el.room.pk %}">
<strong>{{ el.room.short_name }}</strong>
</a>
</span>
{% elif el.room and not el.lesson_period.room %}
{# Only new room available #}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ sub.room.name }}">
<a href="{% url "timetable" "room" sub.room.pk %}">
{{ sub.room.short_name }}
</a>
</span>
{% elif not sub.room and not sub.lesson_period.room %}
data-tooltip="{{ el.room.name }}"
title="{{ el.room.name }}">
<a href="{% url "timetable" "room" el.room.pk %}">
{{ el.room.short_name }}
</a>
</span>
{% elif not el.room and not el.lesson_period.room %}
{# Nothing to view #}
{% else %}
{# Only old room available #}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ sub.lesson_period.room.name }}">
<a href="{% url "timetable" "room" sub.lesson_period.room.pk %}">
{{ sub.lesson_period.room.short_name }}
</a>
</span>
data-tooltip="{{ el.lesson_period.room.name }}"
title="{{ el.lesson_period.room.name }}">
<a href="{% url "timetable" "room" el.lesson_period.room.pk %}">
{{ el.lesson_period.room.short_name }}
</a>
</span>
{% endif %}
{% else %}
{% for room in sub.rooms %}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ room.name }}">
<a href="{% url "timetable_smart_plan" "room" room.id %}">
<strong>{{ room.short_name }}{% if not forloop.last %},{% endif %}</strong>
</a>
</span>
{% endfor %}
{% elif type == "supervision_substitution" %}
{% with supervision=el.supervision %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ supervision.area.name }}" title="{{ supervision.area.name }}">
{{ supervision.area.short_name }}
</span>
{% endwith %}
{% endif %}
{% load i18n %}
{% if not sub.sub.is_event %}
{% if sub.sub.type == 3 %}
<strong>{% trans "Supervision" %}</strong>
{% elif not sub.lesson_period.lesson.subject and not sub.subject %}
{% elif sub.sub.type == 1 or sub.sub.type == 2 %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ sub.lesson_period.lesson.subject.name }}">
<s>{{ sub.lesson_period.lesson.subject.abbrev }}</s>
</span>
{% elif sub.subject and sub.lesson_period.lesson.subject %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ sub.lesson_period.lesson.subject.name }}">
<s>{{ sub.lesson_period.lesson.subject.abbrev }}</s>
</span>
{% if type == "substitution" %}
{% if not el.lesson_period.lesson.subject and not el.subject %}
{% elif el.cancelled or el.cancelled_for_teachers %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.lesson_period.lesson.subject.name }}">
<s>{{ el.lesson_period.lesson.subject.abbrev }}</s>
</span>
{% elif el.subject and el.lesson_period.lesson.subject %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.lesson_period.lesson.subject.name }}">
<s>{{ el.lesson_period.lesson.subject.abbrev }}</s>
</span>
<span data-position="bottom" class="tooltipped" data-tooltip="{{ sub.subject.name }}">
<strong>{{ sub.subject.abbrev }}</strong>
</span>
{% elif sub.subject and not sub.lesson_period.lesson.subject %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ sub.subject.name }}">
<strong>{{ sub.subject.abbrev }}</strong>
</span>
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.subject.name }}">
<strong>{{ el.subject.abbrev }}</strong>
</span>
{% elif el.subject and not el.lesson_period.lesson.subject %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.subject.name }}">
<strong>{{ el.subject.abbrev }}</strong>
</span>
{% else %}
<span data-position="bottom" class="tooltipped" data-tooltip="{{ sub.lesson_period.lesson.subject.name }}">
<strong>{{ sub.lesson_period.lesson.subject.abbrev }}</strong>
</span>
<span data-position="bottom" class="tooltipped" data-tooltip="{{ el.lesson_period.lesson.subject.name }}">
<strong>{{ el.lesson_period.lesson.subject.abbrev }}</strong>
</span>
{% endif %}
{% elif type == "supervision_substitution" %}
{% trans "Supervision" %}
{% endif %}
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