Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AlekSIS/official/AlekSIS-App-Alsijil
  • sunweaver/AlekSIS-App-Alsijil
  • 8tincsoVluke/AlekSIS-App-Alsijil
  • perfreicpo/AlekSIS-App-Alsijil
  • noifobarep/AlekSIS-App-Alsijil
  • 7ingannisdo/AlekSIS-App-Alsijil
  • unmruntartpa/AlekSIS-App-Alsijil
  • balrorebta/AlekSIS-App-Alsijil
  • comliFdifwa/AlekSIS-App-Alsijil
  • 3ranaadza/AlekSIS-App-Alsijil
10 results
Show changes
Commits on Source (37)
Showing
with 699 additions and 466 deletions
...@@ -9,11 +9,20 @@ and this project adheres to `Semantic Versioning`_. ...@@ -9,11 +9,20 @@ and this project adheres to `Semantic Versioning`_.
Unreleased Unreleased
---------- ----------
Changed
~~~~~~~
* Optimize view for one register object ("lesson view") for mobile and tablet devices.
Fixed Fixed
~~~~~ ~~~~~
* Translate table columns and filter button on person overview page. * Translate table columns and filter button on person overview page.
* Show correct status icon for events. * Show correct status icon for events.
* Subjects in full register printout were struck through although they
hadn't changed.
* Table with all register objects didn't work with extra lessons.
* Add missing definitions of some permissions so they can be assigned.
`2.0rc6`_ - 2021-08-25 `2.0rc6`_ - 2021-08-25
---------------------- ----------------------
......
...@@ -4,7 +4,7 @@ AlekSIS (School Information System) — App كتاب السجل (class regis ...@@ -4,7 +4,7 @@ AlekSIS (School Information System) — App كتاب السجل (class regis
AlekSIS AlekSIS
------- -------
This is an application for use with the `AlekSIS`_ platform. This is an application for use with the `AlekSIS®`_ platform.
Features Features
-------- --------
...@@ -44,5 +44,13 @@ full licence text or on the `European Union Public Licence`_ website ...@@ -44,5 +44,13 @@ full licence text or on the `European Union Public Licence`_ website
https://joinup.ec.europa.eu/collection/eupl/guidelines-users-and-developers https://joinup.ec.europa.eu/collection/eupl/guidelines-users-and-developers
(including all other official language versions). (including all other official language versions).
Trademark
---------
AlekSIS® is a registered trademark of the AlekSIS open source project, represented
by Teckids e.V. Please refer to the `trademark policy`_ for hints on using the trademark
AlekSIS®.
.. _AlekSIS: https://edugit.org/AlekSIS/Official/AlekSIS .. _AlekSIS: https://edugit.org/AlekSIS/Official/AlekSIS
.. _European Union Public Licence: https://eupl.eu/ .. _European Union Public Licence: https://eupl.eu/
.. _trademark policy: https://aleksis.org/pages/about
...@@ -69,10 +69,16 @@ class SelectForm(forms.Form): ...@@ -69,10 +69,16 @@ class SelectForm(forms.Form):
layout = Layout(Row("group", "teacher")) layout = Layout(Row("group", "teacher"))
group = forms.ModelChoiceField( group = forms.ModelChoiceField(
queryset=None, label=_("Group"), required=False, widget=Select2Widget, queryset=None,
label=_("Group"),
required=False,
widget=Select2Widget,
) )
teacher = forms.ModelChoiceField( teacher = forms.ModelChoiceField(
queryset=None, label=_("Teacher"), required=False, widget=Select2Widget, queryset=None,
label=_("Teacher"),
required=False,
widget=Select2Widget,
) )
def clean(self) -> dict: def clean(self) -> dict:
...@@ -211,7 +217,10 @@ class AssignGroupRoleForm(forms.ModelForm): ...@@ -211,7 +217,10 @@ class AssignGroupRoleForm(forms.ModelForm):
widget=ModelSelect2MultipleWidget( widget=ModelSelect2MultipleWidget(
model=Group, model=Group,
search_fields=["name__icontains", "short_name__icontains"], search_fields=["name__icontains", "short_name__icontains"],
attrs={"data-minimum-input-length": 0, "class": "browser-default",}, attrs={
"data-minimum-input-length": 0,
"class": "browser-default",
},
), ),
) )
person = forms.ModelChoiceField( person = forms.ModelChoiceField(
......
...@@ -68,7 +68,8 @@ class RegisterObjectRelatedQuerySet(QuerySet): ...@@ -68,7 +68,8 @@ class RegisterObjectRelatedQuerySet(QuerySet):
When(day__isnull=True, then="event__date_start"), When(day__isnull=True, then="event__date_start"),
), ),
day_end=Case( day_end=Case(
When(day__isnull=False, then="day"), When(day__isnull=True, then="event__date_end"), When(day__isnull=False, then="day"),
When(day__isnull=True, then="event__date_end"),
), ),
) )
...@@ -76,8 +77,14 @@ class RegisterObjectRelatedQuerySet(QuerySet): ...@@ -76,8 +77,14 @@ class RegisterObjectRelatedQuerySet(QuerySet):
"""Annotate lesson documentations with the subjects.""" """Annotate lesson documentations with the subjects."""
return self.annotate( return self.annotate(
subject=Case( subject=Case(
When(lesson_period__isnull=False, then="lesson_period__lesson__subject__name",), When(
When(extra_lesson__isnull=False, then="extra_lesson__subject__name",), lesson_period__isnull=False,
then="lesson_period__lesson__subject__name",
),
When(
extra_lesson__isnull=False,
then="extra_lesson__subject__name",
),
default=Value(_("Event")), default=Value(_("Event")),
) )
) )
...@@ -142,7 +149,12 @@ class GroupRoleQuerySet(QuerySet): ...@@ -142,7 +149,12 @@ class GroupRoleQuerySet(QuerySet):
qs = GroupRoleAssignment.objects.on_day(time_ref) qs = GroupRoleAssignment.objects.on_day(time_ref)
qs = qs.for_groups(groups).distinct() qs = qs.for_groups(groups).distinct()
return self.prefetch_related(Prefetch("assignments", queryset=qs,)) return self.prefetch_related(
Prefetch(
"assignments",
queryset=qs,
)
)
class GroupRoleAssignmentManager(CurrentSiteManagerWithoutMigrations): class GroupRoleAssignmentManager(CurrentSiteManagerWithoutMigrations):
......
...@@ -105,7 +105,11 @@ def mark_absent( ...@@ -105,7 +105,11 @@ def mark_absent(
.prefetch_related(None) .prefetch_related(None)
.update_or_create( .update_or_create(
person=self, person=self,
defaults={"absent": absent, "excused": excused, "excuse_type": excuse_type,}, defaults={
"absent": absent,
"excused": excused,
"excuse_type": excuse_type,
},
**q_attrs, **q_attrs,
) )
) )
...@@ -155,7 +159,13 @@ def get_personal_notes( ...@@ -155,7 +159,13 @@ def get_personal_notes(
) )
# Create all missing personal notes # Create all missing personal notes
new_personal_notes = [PersonalNote(person=person, **q_attrs,) for person in missing_persons] new_personal_notes = [
PersonalNote(
person=person,
**q_attrs,
)
for person in missing_persons
]
PersonalNote.objects.bulk_create(new_personal_notes) PersonalNote.objects.bulk_create(new_personal_notes)
for personal_note in new_personal_notes: for personal_note in new_personal_notes:
...@@ -177,10 +187,12 @@ ExtraLesson.method(get_personal_notes) ...@@ -177,10 +187,12 @@ ExtraLesson.method(get_personal_notes)
# Dynamically add extra permissions to Group and Person models in core # Dynamically add extra permissions to Group and Person models in core
# Note: requires migrate afterwards # Note: requires migrate afterwards
Group.add_permission( Group.add_permission(
"view_week_class_register_group", _("Can view week overview of group class register"), "view_week_class_register_group",
_("Can view week overview of group class register"),
) )
Group.add_permission( Group.add_permission(
"view_lesson_class_register_group", _("Can view lesson overview of group class register"), "view_lesson_class_register_group",
_("Can view lesson overview of group class register"),
) )
Group.add_permission("view_personalnote_group", _("Can view all personal notes of a group")) Group.add_permission("view_personalnote_group", _("Can view all personal notes of a group"))
Group.add_permission("edit_personalnote_group", _("Can edit all personal notes of a group")) Group.add_permission("edit_personalnote_group", _("Can edit all personal notes of a group"))
...@@ -194,6 +206,7 @@ Group.add_permission("view_full_register_group", _("Can view full register of a ...@@ -194,6 +206,7 @@ Group.add_permission("view_full_register_group", _("Can view full register of a
Group.add_permission( Group.add_permission(
"register_absence_group", _("Can register an absence for all members of a group") "register_absence_group", _("Can register an absence for all members of a group")
) )
Group.add_permission("assign_grouprole", _("Can assign a group role for this group"))
Person.add_permission("register_absence_person", _("Can register an absence for a person")) Person.add_permission("register_absence_person", _("Can register an absence for a person"))
...@@ -206,7 +219,8 @@ def get_lesson_documentation( ...@@ -206,7 +219,8 @@ def get_lesson_documentation(
week = self.week week = self.week
# Use all to make effect of prefetched data # Use all to make effect of prefetched data
doc_filter = filter( doc_filter = filter(
lambda d: d.week == week.week and d.year == week.year, self.documentations.all(), lambda d: d.week == week.week and d.year == week.year,
self.documentations.all(),
) )
try: try:
return next(doc_filter) return next(doc_filter)
...@@ -409,7 +423,8 @@ def generate_person_list_with_class_register_statistics( ...@@ -409,7 +423,8 @@ def generate_person_list_with_class_register_statistics(
) )
).annotate( ).annotate(
absences_count=Count( absences_count=Count(
"filtered_personal_notes", filter=Q(filtered_personal_notes__absent=True), "filtered_personal_notes",
filter=Q(filtered_personal_notes__absent=True),
), ),
excused=Count( excused=Count(
"filtered_personal_notes", "filtered_personal_notes",
...@@ -425,7 +440,8 @@ def generate_person_list_with_class_register_statistics( ...@@ -425,7 +440,8 @@ def generate_person_list_with_class_register_statistics(
), ),
tardiness=Sum("filtered_personal_notes__late"), tardiness=Sum("filtered_personal_notes__late"),
tardiness_count=Count( tardiness_count=Count(
"filtered_personal_notes", filter=Q(filtered_personal_notes__late__gt=0), "filtered_personal_notes",
filter=Q(filtered_personal_notes__late__gt=0),
), ),
) )
......
...@@ -229,7 +229,11 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel): ...@@ -229,7 +229,11 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel):
late = models.PositiveSmallIntegerField(default=0) late = models.PositiveSmallIntegerField(default=0)
excused = models.BooleanField(default=False) excused = models.BooleanField(default=False)
excuse_type = models.ForeignKey( excuse_type = models.ForeignKey(
ExcuseType, on_delete=models.SET_NULL, null=True, blank=True, verbose_name=_("Excuse type"), ExcuseType,
on_delete=models.SET_NULL,
null=True,
blank=True,
verbose_name=_("Excuse type"),
) )
remarks = models.CharField(max_length=200, blank=True) remarks = models.CharField(max_length=200, blank=True)
...@@ -283,13 +287,16 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel): ...@@ -283,13 +287,16 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel):
check=lesson_related_constraint_q, name="one_relation_only_personal_note" check=lesson_related_constraint_q, name="one_relation_only_personal_note"
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "lesson_period", "person"), name="unique_note_per_lp", fields=("week", "year", "lesson_period", "person"),
name="unique_note_per_lp",
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "event", "person"), name="unique_note_per_ev", fields=("week", "year", "event", "person"),
name="unique_note_per_ev",
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "extra_lesson", "person"), name="unique_note_per_el", fields=("week", "year", "extra_lesson", "person"),
name="unique_note_per_el",
), ),
] ]
...@@ -327,7 +334,8 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel): ...@@ -327,7 +334,8 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
Can be deactivated using site preference ``alsijil__carry_over``. Can be deactivated using site preference ``alsijil__carry_over``.
""" """
all_periods_of_lesson = LessonPeriod.objects.filter( all_periods_of_lesson = LessonPeriod.objects.filter(
lesson=self.lesson_period.lesson, period__weekday=self.lesson_period.period.weekday, lesson=self.lesson_period.lesson,
period__weekday=self.lesson_period.period.weekday,
) )
for period in all_periods_of_lesson: for period in all_periods_of_lesson:
lesson_documentation = period.get_or_create_lesson_documentation( lesson_documentation = period.get_or_create_lesson_documentation(
...@@ -375,16 +383,20 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel): ...@@ -375,16 +383,20 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
] ]
constraints = [ constraints = [
CheckConstraint( CheckConstraint(
check=lesson_related_constraint_q, name="one_relation_only_lesson_documentation", check=lesson_related_constraint_q,
name="one_relation_only_lesson_documentation",
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "lesson_period"), name="unique_documentation_per_lp", fields=("week", "year", "lesson_period"),
name="unique_documentation_per_lp",
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "event"), name="unique_documentation_per_ev", fields=("week", "year", "event"),
name="unique_documentation_per_ev",
), ),
models.UniqueConstraint( models.UniqueConstraint(
fields=("week", "year", "extra_lesson"), name="unique_documentation_per_el", fields=("week", "year", "extra_lesson"),
name="unique_documentation_per_el",
), ),
] ]
...@@ -433,6 +445,7 @@ class GroupRole(ExtensibleModel): ...@@ -433,6 +445,7 @@ class GroupRole(ExtensibleModel):
constraints = [ constraints = [
models.UniqueConstraint(fields=("site_id", "name"), name="unique_role_per_site"), models.UniqueConstraint(fields=("site_id", "name"), name="unique_role_per_site"),
] ]
permissions = (("assign_group_role", _("Can assign group role")),)
class GroupRoleAssignment(GroupPropertiesMixin, ExtensibleModel): class GroupRoleAssignment(GroupPropertiesMixin, ExtensibleModel):
...@@ -451,7 +464,9 @@ class GroupRoleAssignment(GroupPropertiesMixin, ExtensibleModel): ...@@ -451,7 +464,9 @@ class GroupRoleAssignment(GroupPropertiesMixin, ExtensibleModel):
verbose_name=_("Assigned person"), verbose_name=_("Assigned person"),
) )
groups = models.ManyToManyField( groups = models.ManyToManyField(
"core.Group", related_name="group_roles", verbose_name=_("Groups"), "core.Group",
related_name="group_roles",
verbose_name=_("Groups"),
) )
date_start = models.DateField(verbose_name=_("Start date")) date_start = models.DateField(verbose_name=_("Start date"))
date_end = models.DateField( date_end = models.DateField(
...@@ -481,7 +496,9 @@ class AlsijilGlobalPermissions(GlobalPermissionModel): ...@@ -481,7 +496,9 @@ class AlsijilGlobalPermissions(GlobalPermissionModel):
class Meta: class Meta:
managed = False managed = False
permissions = ( permissions = (
("view_lesson", _("Can view lesson overview")),
("view_week", _("Can view week overview")), ("view_week", _("Can view week overview")),
("view_full_register", _("Can view full register")),
("register_absence", _("Can register absence")), ("register_absence", _("Can register absence")),
("list_personal_note_filters", _("Can list all personal note filters")), ("list_personal_note_filters", _("Can list all personal note filters")),
) )
...@@ -185,17 +185,19 @@ view_person_overview_personal_notes_predicate = view_person_overview_predicate & ...@@ -185,17 +185,19 @@ view_person_overview_personal_notes_predicate = view_person_overview_predicate &
| has_person_group_object_perm("core.view_personalnote_group") | has_person_group_object_perm("core.view_personalnote_group")
) )
add_perm( add_perm(
"alsijil.view_person_overview_personalnote_rule", view_person_overview_personal_notes_predicate, "alsijil.view_person_overview_personalnote_rule",
view_person_overview_personal_notes_predicate,
) )
# Edit person overview personal notes # Edit person overview personal notes
edit_person_overview_personal_notes_predicate = view_person_overview_predicate & ( edit_person_overview_personal_notes_predicate = view_person_overview_predicate & (
~is_current_person ~is_current_person
| has_global_perm("alsijil.edit_personalnote") | has_global_perm("alsijil.change_personalnote")
| has_person_group_object_perm("core.edit_personalnote_group") | has_person_group_object_perm("core.edit_personalnote_group")
) )
add_perm( add_perm(
"alsijil.edit_person_overview_personalnote_rule", edit_person_overview_personal_notes_predicate, "alsijil.edit_person_overview_personalnote_rule",
edit_person_overview_personal_notes_predicate,
) )
# View person statistics on personal notes # View person statistics on personal notes
...@@ -305,6 +307,6 @@ add_perm("alsijil.delete_grouproleassignment_rule", delete_group_role_assignment ...@@ -305,6 +307,6 @@ add_perm("alsijil.delete_grouproleassignment_rule", delete_group_role_assignment
view_register_objects_list_predicate = has_person & ( view_register_objects_list_predicate = has_person & (
has_any_object("core.view_full_register_group", Group) has_any_object("core.view_full_register_group", Group)
| has_global_perm("core.view_full_register") | has_global_perm("alsijil.view_full_register")
) )
add_perm("alsijil.view_register_objects_list_rule", view_register_objects_list_predicate) add_perm("alsijil.view_register_objects_list_rule", view_register_objects_list_predicate)
...@@ -30,18 +30,10 @@ td.rotate, th.rotate { ...@@ -30,18 +30,10 @@ td.rotate, th.rotate {
transform: rotate(-90deg); transform: rotate(-90deg);
} }
tr.lesson-cancelled td.subj {
text-decoration: line-through;
}
tr.lesson-cancelled td { tr.lesson-cancelled td {
background-color: #EF9A9A; background-color: #EF9A9A;
} }
tr.lesson-substituted td.lesson-subj {
text-decoration: line-through;
}
tr.lesson-substituted td { tr.lesson-substituted td {
background-color: #ffb74d; background-color: #ffb74d;
} }
......
...@@ -23,6 +23,55 @@ ...@@ -23,6 +23,55 @@
height: 109px;} height: 109px;}
} }
.alsijil-top-button { .alsijil-time-head, .alsijil-object-head {
margin-top: -20px; display: block;
} }
.alsijil-time-head {
font-size: 2rem;
line-height: 1.1;
}
.alsijil-object-head {
font-size: 3rem;
}
@media only screen and (max-width: 600px) {
.alsijil-time-head {
font-size: 1.5rem;
}
.alsijil-object-head {
font-size: 2.2rem;
line-height: 1.4;
}
}
.alsijil-nav {
line-height: 36px;
}
.alsijil-header-nav-button {
height: 66px;
padding: 0;
}
.alsijil-header-nav-button.left {
margin-right: 5px;
}
.alsijil-header-nav-button.right {
margin-left: 5px;
}
.alsijil-header-nav-button i.material-icons {
line-height: 60px;
height: 60px;
font-size: 40px;
}
.alsijil-nav-header {
width: calc(100% + 40px);
padding: 10px 20px;
margin: -10px -20px 0;
}
\ No newline at end of file
...@@ -192,15 +192,15 @@ class RegisterObjectTable(tables.Table): ...@@ -192,15 +192,15 @@ class RegisterObjectTable(tables.Table):
group_note = tables.Column(linkify=_get_link) group_note = tables.Column(linkify=_get_link)
def render_status(self, value, record): def render_status(self, value, record):
return render_to_string( context = {
"alsijil/partials/lesson_status_icon.html", "has_documentation": record.get("has_documentation", False),
dict( "register_object": value,
week=record.get("week"), }
has_documentation=record.get("has_documentation", False), if record.get("week"):
substitution=record.get("substitution"), context["week"] = record["week"]
register_object=value, if record.get("substitution"):
), context["substitution"] = record["substitution"]
) return render_to_string("alsijil/partials/lesson_status.html", context)
class RegisterObjectSelectTable(RegisterObjectTable): class RegisterObjectSelectTable(RegisterObjectTable):
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
{% if can_view_lesson_documentation %} {% if can_view_lesson_documentation %}
<tr> <tr>
<td class="center-align"> <td class="center-align">
{% include "alsijil/partials/lesson_status_icon.html" with register_object=register_object %} {% include "alsijil/partials/lesson_status.html" with register_object=register_object %}
</td> </td>
<td class="tr-link"> <td class="tr-link">
<a class="tr-link" <a class="tr-link"
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
{% if can_view_lesson_documentation %} {% if can_view_lesson_documentation %}
<a class="collection-item avatar" <a class="collection-item avatar"
href="{{ register_object.alsijil_url }}?back={{ back_url }}"> href="{{ register_object.alsijil_url }}?back={{ back_url }}">
{% include "alsijil/partials/lesson_status_icon.html" with register_object=register_object css_class="materialize-circle" color_suffix=" " %} {% include "alsijil/partials/lesson_status.html" with register_object=register_object css_class="materialize-circle" color_suffix=" " %}
<table class="hide-on-med-and-down"> <table class="hide-on-med-and-down">
<tr> <tr>
<th>{% trans "Subject" %}</th> <th>{% trans "Subject" %}</th>
......
{% load i18n %}
<h1>
<span class="right hide-on-small-only">
{% include "alsijil/partials/lesson_status.html" with register_object=register_object css_class="medium" %}
</span>
<a class="btn-flat waves-effect waves-light primary-color-text left alsijil-header-nav-button hide-on-med-and-up {% if not prev_lesson %}disabled{% endif %}"
{% if prev_lesson %}
href="{% url "lesson_period" prev_lesson.week.year prev_lesson.week.week prev_lesson.id %}"
{% endif %}
>
<i class="material-icons center">navigate_before</i>
</a>
<a class="btn-flat waves-effect waves-light primary-color-text right alsijil-header-nav-button hide-on-med-and-up {% if not next_lesson %}disabled{% endif %}"
{% if next_lesson %}
href="{% url "lesson_period" next_lesson.week.year next_lesson.week.week next_lesson.id %}"
{% endif %}
>
<i class="material-icons center">navigate_next</i>
</a>
<span class="alsijil-time-head">
{% if register_object.label_ == "event" %}
{% if register_object.date_start == register_object.date_end %}
{% if register_object.period_from.period == register_object.period_to.period %}
{{ register_object.date_start|date:"SHORT_DATE_FORMAT" }},
{% blocktrans with period=register_object.period_from.period %}{{ period }}. period{% endblocktrans %}
{% else %}
{{ register_object.date_start|date:"SHORT_DATE_FORMAT" }},
{% blocktrans with period_from=register_object.period_from.period period_to=register_object.period_to.period %}
{{ period_from }}.–{{ period_to }}. period
{% endblocktrans %}
{% endif %}
{% else %}
{{ register_object.date_start|date:"SHORT_DATE_FORMAT" }},
{{ register_object.period_from.period }}.–{{ register_object.date_end|date:"SHORT_DATE_FORMAT" }},
{{ register_object.period_to.period }}.
{% endif %}
{% else %}
{{ day|date:"SHORT_DATE_FORMAT" }},
{% blocktrans with period=register_object.period.period %}{{ period }}. period{% endblocktrans %}
{% endif %}
</span>
<span class="alsijil-object-head">
{{ register_object.group_names }},
{% if register_object.label_ == "event" %}
{% trans "Event" %} ({{ register_object.title }}),
{% else %}
{{ register_object.get_subject.short_name }},
{% endif %}
{{ register_object.teacher_short_names }}
</span>
</h1>
<div class="hide-on-med-and-up margin-bottom">
{% include "alsijil/partials/lesson_status.html" with register_object=register_object chip=1 css_class="hundred-percent center" %}
</div>
{% load i18n %}
<div class="row no-margin hide-on-small-only">
<div class="col s12 no-padding">
{% if not blocked_because_holidays and with_save %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
<button type="submit" class="btn waves-effect waves-light green margin-bottom">
<i class="material-icons left">save</i> {% trans "Save" %}
</button>
{% endif %}
{% endif %}
<a class="btn waves-effect waves-light primary margin-bottom {% if not prev_lesson %}disabled{% endif %}"
{% if prev_lesson %}
href="{% url "lesson_period" prev_lesson.week.year prev_lesson.week.week prev_lesson.id %}"
{% endif %}
>
<i class="material-icons left">arrow_back</i>
{% blocktrans with subject=register_object.get_subject.short_name %}
Previous {{ subject }} lesson
{% endblocktrans %}
</a>
<a class="btn right waves-effect waves-light primary margin-bottom {% if not next_lesson %}disabled{% endif %}"
{% if next_lesson %}
href="{% url "lesson_period" next_lesson.week.year next_lesson.week.week next_lesson.id %}"
{% endif %}
>
<i class="material-icons right">arrow_forward</i>
{% blocktrans with subject=register_object.get_subject.short_name %}
Next {{ subject }} lesson
{% endblocktrans %}
</a>
</div>
</div>
{% load i18n material_form_internal material_form %}
{% include "alsijil/partials/lesson/heading.html" %}
{% include "alsijil/partials/lesson/prev_next.html" with with_save=0 %}
<div class="hide-on-med-and-up margin-bottom">
{% if not blocked_because_holidays %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
{% include "core/partials/save_button.html" %}
{% endif %}
{% endif %}
</div>
<div class="card">
<div class="card-content">
<span class="card-title">
{% blocktrans %}Lesson documentation{% endblocktrans %}
</span>
{% if can_edit_lesson_documentation %}
{% form form=lesson_documentation_form %}{% endform %}
{% elif can_view_lesson_documentation %}
<table>
<tr>
<th>
{% trans "Lesson topic" %}
</th>
<td>
{{ lesson_documentation.topic }}
</td>
</tr>
<tr>
<th>
{% trans "Homework" %}
</th>
<td>
{{ lesson_documentation.homework }}
</td>
</tr>
<tr>
<th>
{% trans "Group note" %}
</th>
<td>
{{ lesson_documentation.group_note }}
</td>
</tr>
</table>
{% endif %}
</div>
<div class="card-action-light hide-on-small-only">
{% if not blocked_because_holidays %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
{% include "core/partials/save_button.html" %}
{% endif %}
{% endif %}
</div>
</div>
<div class="hide-on-med-and-up">
{% if not blocked_because_holidays %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
{% include "core/partials/save_button.html" %}
{% endif %}
{% endif %}
</div>
\ No newline at end of file
{% load i18n %}
{% include "alsijil/partials/lesson/heading.html" %}
{% if group_roles %}
{% include "alsijil/group_role/partials/assigned_roles.html" with roles=group_roles group=register_object.get_groups.first back_url=back_url %}
{% endif %}
{% if can_view_lesson_documentation %}
<div class="card">
<div class="card-content">
<span class="card-title">
{% blocktrans %}Change history{% endblocktrans %}
</span>
{% include 'core/partials/crud_events.html' with obj=lesson_documentation %}
</div>
</div>
{% endif %}
\ No newline at end of file
{% load i18n material_form_internal material_form time_helpers %}
{% include "alsijil/partials/lesson/heading.html" %}
{% include "alsijil/partials/lesson/prev_next.html" with with_save=1 %}
{% if not blocked_because_holidays %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
<button type="submit"
class="btn waves-effect waves-light green margin-bottom hundred-percent hide-on-med-and-up">
<i class="material-icons left">save</i> {% trans "Save" %}
</button>
{% endif %}
{% endif %}
<div class="card">
<div class="card-content">
<span class="card-title">
{% blocktrans %}Personal notes{% endblocktrans %}
</span>
{% if can_edit_register_object_personalnote %}
{% form form=personal_note_formset.management_form %}{% endform %}
{% endif %}
<table class="striped responsive-table alsijil-table">
<thead>
<tr>
<th>{% blocktrans %}Person{% endblocktrans %}</th>
<th>{% blocktrans %}Absent{% endblocktrans %}</th>
<th>{% blocktrans %}Tardiness{% endblocktrans %}</th>
<th>{% blocktrans %}Excused{% endblocktrans %}</th>
<th>{% blocktrans %}Excuse type{% endblocktrans %}</th>
<th>{% blocktrans %}Extra marks{% endblocktrans %}</th>
<th>{% blocktrans %}Remarks{% endblocktrans %}</th>
</tr>
</thead>
<tbody>
{% for form in personal_note_formset %}
{% if can_edit_register_object_personalnote %}
<tr>
{{ form.id }}
<td>{{ form.person_name }}{{ form.person_name.value }}
<p>
{% for assignment in form.instance.person.group_roles.all %}
{% include "alsijil/group_role/chip.html" with role=assignment.role %}
{% endfor %}
</p>
</td>
<td class="center-align">
<label>
{{ form.absent }}
<span></span>
</label>
</td>
<td>
<div class="input-field">
{{ form.late }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Tardiness (in m)" %}
</label>
</div>
</td>
<td class="center-align">
<label>
{{ form.excused }}
<span></span>
</label>
</td>
<td>
<div class="input-field">
{{ form.excuse_type }}
<label for="{{ form.excuse_type.id_for_label }}">
{% trans "Excuse type" %}
</label>
</div>
</td>
<td>
{% for group, items in form.extra_marks|select_options %}
{% for choice, value, selected in items %}
<label class="{% if selected %} active{% endif %} alsijil-check-box">
<input type="checkbox"
{% if value == None or value == '' %}disabled{% else %}value="{{ value }}"{% endif %}
{% if selected %} checked="checked"{% endif %}
name="{{ form.extra_marks.html_name }}">
<span>{{ choice }}</span>
</label>
{% endfor %}
{% endfor %}
</td>
<td>
<div class="input-field">
{{ form.remarks }}
<label for="{{ form.remarks.id_for_label }}">
{% trans "Remarks" %}
</label>
</div>
</td>
</tr>
{% else %}
<tr>
<td>{{ form.person_name.value }}
<p>
{% for assignment in form.instance.person.group_roles.all %}
{% include "alsijil/group_role/chip.html" with role=assignment.role %}
{% endfor %}
</p>
</td>
<td><i class="material-icons center">{{ form.absent.value|yesno:"check,clear" }}</i></td>
<td>
<i class="material-icons center">{{ form.late.value|yesno:"check,clear" }}</i>
<span class="alsijil-tardiness-text">
{% if form.late.value %}{{ form.late.value|to_time|time:"i\m" }}{% endif %}
</span>
</td>
<td><i class="material-icons center">{{ form.excused.value|yesno:"check,clear" }}</i></td>
<td>{% firstof form.excuse_type.value "–" %}</td>
<td>
{% for extra_mark in form.extra_marks.value %}
{{ extra_mark }}{% if not forloop.last %},{% endif %}
{% empty %}
{% endfor %}
</td>
<td>{% firstof form.remarks.value "–" %}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if not blocked_because_holidays %}
{% if can_edit_lesson_documentation or can_edit_register_object_personalnote %}
<button type="submit"
class="btn waves-effect waves-light green margin-bottom hundred-percent hide-on-med-and-up">
<i class="material-icons left">save</i> {% trans "Save" %}
</button>
{% endif %}
{% endif %}
\ No newline at end of file
{% load i18n rules %}
<div class="card">
<div class="card-content">
<span class="card-title">
{% blocktrans %}Overview: Previous lesson{% endblocktrans %} ({{ prev_doc.date_formatted }},
{% blocktrans with period=prev_lesson.period.period %}{{ period }}. period{% endblocktrans %})
</span>
<table>
{% if prev_doc.topic %}
<tr>
<th class="collection-item">{% trans "Lesson topic of previous lesson:" %}</th>
<td>{{ prev_doc.topic }}</td>
</tr>
{% endif %}
{% if prev_doc.homework %}
<tr>
<th class="collection-item">{% trans "Homework for this lesson:" %}</th>
<td>{{ prev_doc.homework }}</td>
</tr>
{% endif %}
{% if prev_doc.group_note %}
<tr>
<th class="collection-item">{% trans "Group notes for previous lesson:" %}</th>
<td>{{ prev_doc.group_note }}</td>
</tr>
{% endif %}
{% if absences %}
<tr>
<th>{% trans "Absent persons:" %}</th>
<td>{% include "alsijil/partials/absences.html" with notes=absences %}</td>
</tr>
{% endif %}
{% if tardinesses %}
<tr>
<th>{% trans "Late persons:" %}</th>
<td>{% include "alsijil/partials/tardinesses.html" with notes=tardinesses %}</td>
</tr>
{% endif %}
{% for extra_mark, notes in extra_marks.items %}
<tr>
<th>{{ extra_mark.name }}</th>
<td>
{% for note in notes %}
{% has_perm "alsijil.view_personalnote_rule" user note as can_view_personalnote %}
{% if can_view_personalnote %}
<span>{{ note.person }}{% if not forloop.last %},{% endif %}</span>
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
\ No newline at end of file
{% load i18n week_helpers %}
{% now_datetime as now_dt %}
{% if has_documentation or register_object.has_documentation %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Data complete") icon="check_circle" color="green" %}
{% elif not register_object.period %}
{% if week %}
{% period_to_time_start week register_object.raw_period_from_on_day as time_start %}
{% period_to_time_end week register_object.raw_period_to_on_day as time_end %}
{% else %}
{% period_to_time_start register_object.date_start register_object.period_from as time_start %}
{% period_to_time_end register_object.date_end register_object.period_to as time_end %}
{% endif %}
{% if now_dt > time_end %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Missing data") icon="warning" color="red" %}
{% elif now_dt > time_start and now_dt < time_end %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Pending") icon="more_horiz" color="orange" %}
{% else %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Event") icon="event" color="purple" %}
{% endif %}
{% else %}
{% period_to_time_start week register_object.period as time_start %}
{% period_to_time_end week register_object.period as time_end %}
{% if substitution.cancelled or register_object.get_substitution.cancelled %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Lesson cancelled") icon="cancel" color="red" %}
{% elif now_dt > time_end %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Missing data") icon="warning" color="red" %}
{% elif now_dt > time_start and now_dt < time_end %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Pending") icon="more_horiz" color="orange" %}
{% elif substitution or register_object.get_substitution %}
{% include "alsijil/partials/lesson_status_icon.html" with text=_("Substitution") icon="update" color="orange" %}
{% endif %}
{% endif %}
{% load i18n week_helpers %} {% if chip %}
<span class="{% if chip %}chip{% endif %} {{ color }} white-text {{ css_class }}">
{% now_datetime as now_dt %} <i class="material-icons left">
{{ icon }}
{% if has_documentation or register_object.has_documentation %} </i>
<i class="material-icons green{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Data complete" %}" title="{% trans "Data complete" %}">check_circle</i> {{ text }}
{% elif not register_object.period %} </span>
{% period_to_time_start week register_object.raw_period_from_on_day as time_start %}
{% period_to_time_end week register_object.raw_period_to_on_day as time_end %}
{% if now_dt > time_end %}
<i class="material-icons red{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Missing data" %}" title="{% trans "Missing data" %}">history</i>
{% elif now_dt > time_start and now_dt < time_end %}
<i class="material-icons orange{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Pending" %}" title="{% trans "Pending" %}">more_horiz</i>
{% else %}
<i class="material-icons purple{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Event" %}" title="{% trans "Event" %}">event</i>
{% endif %}
{% else %} {% else %}
{% period_to_time_start week register_object.period as time_start %} <i class="material-icons {{ color }}{% firstof color_suffix "-text" %} tooltipped {{ css_class }}"
{% period_to_time_end week register_object.period as time_end %} data-position="bottom"
data-tooltip="{{ text }}" title="{{ text }}">
{% if substitution.cancelled or register_object.get_substitution.cancelled %} {{ icon }}
<i class="material-icons red{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Lesson cancelled" %}" title="{% trans "Lesson cancelled" %}">cancel</i> </i>
{% elif now_dt > time_end %}
<i class="material-icons red{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Missing data" %}" title="{% trans "Missing data" %}">history</i>
{% elif now_dt > time_start and now_dt < time_end %}
<i class="material-icons orange{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Pending" %}" title="{% trans "Pending" %}">more_horiz</i>
{% elif substitution or register_object.get_substitution %}
<i class="material-icons orange{% firstof color_suffix "-text"%} tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Substitution" %}" title="{% trans "Substitution" %}">update</i>
{% endif %}
{% endif %} {% endif %}