diff --git a/aleksis/apps/alsijil/locale/ar/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/ar/LC_MESSAGES/django.po index faa115baa37ae9bda0f9670c89a95f268c5dd114..cc86fc5cf3595ae437aef2bd28e649204b1af4ff 100644 --- a/aleksis/apps/alsijil/locale/ar/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/ar/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -36,23 +36,24 @@ msgstr "" msgid "You can't select a group and a teacher both." msgstr "" -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "" -#: forms.py:127 +#: forms.py:128 msgid "Start period" msgstr "" -#: forms.py:128 +#: forms.py:129 msgid "End period" msgstr "" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -60,7 +61,8 @@ msgstr "" msgid "Absent" msgstr "" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -71,13 +73,13 @@ msgstr "" msgid "Excused" msgstr "" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 msgid "Excuse type" msgstr "" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -109,13 +111,13 @@ msgstr "" msgid "My students" msgstr "" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 msgid "Excuse types" msgstr "" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -125,19 +127,19 @@ msgstr "" msgid "Extra marks" msgstr "" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "" -#: model_extensions.py:152 +#: model_extensions.py:155 msgid "Can view all personal notes of a group" msgstr "" -#: model_extensions.py:155 +#: model_extensions.py:156 msgid "Can edit all personal notes of a group" msgstr "" @@ -157,43 +159,43 @@ msgstr "" msgid "Can register an absence for all members of a group" msgstr "" -#: model_extensions.py:168 +#: model_extensions.py:167 msgid "Can register an absence for a person" msgstr "" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 msgid "Short name" msgstr "" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "" -#: models.py:111 +#: models.py:101 msgid "Personal note" msgstr "" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -201,35 +203,35 @@ msgstr "" msgid "Homework" msgstr "" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 msgid "Group note" msgstr "" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 msgid "Lesson documentations" msgstr "" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "" -#: models.py:223 +#: models.py:209 msgid "Can register absence" msgstr "" -#: models.py:224 +#: models.py:210 msgid "Can list all personal note filters" msgstr "" @@ -253,7 +255,7 @@ msgstr "" msgid "This will carry over data only if the data in the following periods are empty." msgstr "" -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "" @@ -282,6 +284,46 @@ msgstr "" msgid "Person" msgstr "" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +msgid "Confirm: Register absence" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:42 +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "" @@ -824,58 +866,58 @@ msgstr "" msgid "Notes" msgstr "" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "" -#: views.py:133 +#: views.py:127 msgid "The lesson documentation has been saved." msgstr "" -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "" -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "" -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "" -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "" -#: views.py:754 +#: views.py:741 msgid "The personal note has been deleted." msgstr "" -#: views.py:775 +#: views.py:762 msgid "The extra mark has been created." msgstr "" -#: views.py:786 +#: views.py:773 msgid "The extra mark has been saved." msgstr "" -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "" -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "" -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "" -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "" diff --git a/aleksis/apps/alsijil/locale/de_DE/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/de_DE/LC_MESSAGES/django.po index 740b4ab755bd4df7134065b87efff2aa57cbe748..add03b74eeb7a5e69c3c19dce2a7bedb2038c90d 100644 --- a/aleksis/apps/alsijil/locale/de_DE/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/de_DE/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" -"PO-Revision-Date: 2020-11-14 11:29+0000\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" +"PO-Revision-Date: 2020-12-05 20:56+0000\n" "Last-Translator: Jonathan Weth <teckids@jonathanweth.de>\n" "Language-Team: German <https://translate.edugit.org/projects/aleksis/" "aleksis-app-alsijil/de/>\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.1.1\n" +"X-Generator: Weblate 4.3.2\n" #: forms.py:29 msgid "Homework for the next lesson" @@ -37,23 +37,24 @@ msgstr "Lehrkraft" msgid "You can't select a group and a teacher both." msgstr "Es kann nur entweder eine Gruppe oder eine Lehrkraft ausgewählt werden." -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "Startdatum" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "Enddatum" -#: forms.py:127 +#: forms.py:128 msgid "Start period" msgstr "Startstunde" -#: forms.py:128 +#: forms.py:129 msgid "End period" msgstr "Endstunde" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -61,7 +62,8 @@ msgstr "Endstunde" msgid "Absent" msgstr "Abwesend" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -72,13 +74,13 @@ msgstr "Abwesend" msgid "Excused" msgstr "Entschuldigt" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 msgid "Excuse type" msgstr "Entschuldigungsart" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -110,13 +112,13 @@ msgstr "Meine Ãœbersicht" msgid "My students" msgstr "Meine Schüler*innen" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 msgid "Excuse types" msgstr "Entschuldigungsarten" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -126,19 +128,19 @@ msgstr "Entschuldigungsarten" msgid "Extra marks" msgstr "Zusätzliche Markierungen" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "Kann Wochenübersicht des Gruppenklassenbuches sehen" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "Kann Stundenübersicht des Gruppenklassenbuches sehen" -#: model_extensions.py:152 +#: model_extensions.py:155 msgid "Can view all personal notes of a group" msgstr "Kann alle persönlichen Notizen einer Gruppe sehen" -#: model_extensions.py:155 +#: model_extensions.py:156 msgid "Can edit all personal notes of a group" msgstr "Kann alle persönlichen Notizen einer Gruppe bearbeiten" @@ -158,43 +160,43 @@ msgstr "Kann komplettes Klassenbuch einer Gruppe sehen" msgid "Can register an absence for all members of a group" msgstr "Kann eine Absenz für alle Mitglieder eine Gruppe registrieren" -#: model_extensions.py:168 +#: model_extensions.py:167 msgid "Can register an absence for a person" msgstr "Kann eine Absenz für eine Person registrieren" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 msgid "Short name" msgstr "Kurzname" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "Name" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "Jahr" -#: models.py:111 +#: models.py:101 msgid "Personal note" msgstr "Persönliche Notiz" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "Persönliche Notizen" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "Stundenthema" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -202,35 +204,35 @@ msgstr "Stundenthema" msgid "Homework" msgstr "Hausaufgaben" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 msgid "Group note" msgstr "Gruppennotiz" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "Stunden-Dokumentation" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 msgid "Lesson documentations" msgstr "Stunden-Dokumentationen" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "Zusätzliche Markierung" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "Kann die Wochenübersicht sehen" -#: models.py:223 +#: models.py:209 msgid "Can register absence" msgstr "Kann eine Absenz registrieren" -#: models.py:224 +#: models.py:210 msgid "Can list all personal note filters" msgstr "Kann alle Filter für persönliche Notizen anzeigen" @@ -254,7 +256,7 @@ msgstr "Daten von der ersten Stunde zu weiteren folgenden Stunden übernehmen" msgid "This will carry over data only if the data in the following periods are empty." msgstr "Dies wird die Daten nur übernehmen, wenn die Daten in den Folgestunden leer sind." -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "Erlaube Lehrkräften, Unterrichtsstunden bereits am gleichen Tag und nicht erst zu Beginn der Stunde zu öffnen" @@ -283,6 +285,57 @@ msgstr "Abwesenheit eintragen" msgid "Person" msgstr "Person" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +msgid "Confirm: Register absence" +msgstr "Bestätigung: Abwesenheit eintragen" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" +"\n" +" Möchten Sie wirklich folgende Abwesenheit eintragen?\n" +" " + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" +"\n" +" Da diese Abwesenheit über mehr als einen Tag geht, \n" +"überprüfen Sie bitte die Richtigkeit Ihres Eintrags erneut.\n" +" " + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr " %(count)s betroffene Stunden " + +#: templates/alsijil/absences/register_confirm.html:42 +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" +"\n" +" Es gibt keine betroffenen Stunden. Das Eintragen dieser " +"Abwesenheit wird keinen Effekt haben.\n" +" " + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "Status auf \"nicht abwesend\" zurücksetzen" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "Abbrechen" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "Schüler*innen" @@ -521,7 +574,9 @@ msgstr "Auswählen" msgid "" "CW %(week)s:\n" " %(instance)s" -msgstr "KW %(week)s: %(instance)s" +msgstr "" +"KW %(week)s: \n" +"%(instance)s" #: templates/alsijil/class_register/week_view.html:84 msgid "Period" @@ -703,7 +758,8 @@ msgid "" msgstr "" "\n" " Dieser Ausdruck ist für Archivierungszwecke gedacht. Die Hauptkopie\n" -" des Klassenbuches ist im AlekSIS-Schul-Informations-System gespeichert.\n" +" des Klassenbuches ist im \n" +"AlekSIS-Schul-Informations-System gespeichert.\n" " " #: templates/alsijil/print/full_register.html:45 @@ -854,61 +910,61 @@ msgstr "Unterrichtsdokumentation für Woche" msgid "Notes" msgstr "Notizen" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" "Sie haben eine ungültige Stunde ausgewählt oder es\n" " läuft momentan keine Stunde." -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "Ihnen ist es nicht erlaubt, eine Eintragung für eine Unterrichtsstunde in der Zukunft vorzunehmen." -#: views.py:133 +#: views.py:127 msgid "The lesson documentation has been saved." msgstr "Die Stunden-Dokumentation wurde gespeichert." -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "Die persönlichen Notizen wurden gespeichert." -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "Die Fehlzeiten wurden als entschuldigt markiert." -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "Die Fehlzeit wurde als entschuldigt markiert." -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "Die Abwesenheit wurde gespeichert." -#: views.py:754 +#: views.py:741 msgid "The personal note has been deleted." msgstr "Die persönliche Notiz wurde gelöscht." -#: views.py:775 +#: views.py:762 msgid "The extra mark has been created." msgstr "Die zusätzliche Markierung wurde erstellt." -#: views.py:786 +#: views.py:773 msgid "The extra mark has been saved." msgstr "Die zusätzliche Markierung wurde gespeichert." -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "Die zusätzliche Markierung wurde gelöscht." -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "Die Entschuldigungsart wurde erstellt." -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "Die Entschuldigunsart wurde gespeichert." -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "Die Entschuldigungsart wurde gelöscht." diff --git a/aleksis/apps/alsijil/locale/fr/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/fr/LC_MESSAGES/django.po index bc689edf464de32e6f80ff2f8f3932b1964149b9..404d2879d67b75879d9fbae9e3f467a4f78e4f96 100644 --- a/aleksis/apps/alsijil/locale/fr/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" "PO-Revision-Date: 2020-07-26 14:08+0000\n" "Last-Translator: Marlene Grundey <grundema@katharineum.de>\n" "Language-Team: French <https://translate.edugit.org/projects/aleksis/aleksis-app-alsijil/fr/>\n" @@ -36,27 +36,28 @@ msgstr "Profs" msgid "You can't select a group and a teacher both." msgstr "" -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "Date de début" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "Date de fin" -#: forms.py:127 +#: forms.py:128 #, fuzzy #| msgid "From period" msgid "Start period" msgstr "De la période" -#: forms.py:128 +#: forms.py:129 #, fuzzy #| msgid "From period" msgid "End period" msgstr "De la période" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -64,7 +65,8 @@ msgstr "De la période" msgid "Absent" msgstr "Absent(e)" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -75,7 +77,7 @@ msgstr "Absent(e)" msgid "Excused" msgstr "Excusé" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 #, fuzzy @@ -83,7 +85,7 @@ msgstr "Excusé" msgid "Excuse type" msgstr "Excusé" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -119,7 +121,7 @@ msgstr "Vue d'ensemble personnelle" msgid "My students" msgstr "" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 #, fuzzy @@ -127,7 +129,7 @@ msgstr "" msgid "Excuse types" msgstr "Excusé" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -137,21 +139,21 @@ msgstr "Excusé" msgid "Extra marks" msgstr "" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "" -#: model_extensions.py:152 +#: model_extensions.py:155 #, fuzzy #| msgid "List of all personal note filters" msgid "Can view all personal notes of a group" msgstr "Liste de filtres de notes personnelles" -#: model_extensions.py:155 +#: model_extensions.py:156 #, fuzzy #| msgid "List of all personal note filters" msgid "Can edit all personal notes of a group" @@ -177,49 +179,49 @@ msgstr "" msgid "Can register an absence for all members of a group" msgstr "" -#: model_extensions.py:168 +#: model_extensions.py:167 #, fuzzy #| msgid "Class register" msgid "Can register an absence for a person" msgstr "Registre de la classe" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 #, fuzzy #| msgid "First name" msgid "Short name" msgstr "Prénom" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "" -#: models.py:111 +#: models.py:101 #, fuzzy #| msgid "Personal notes" msgid "Personal note" msgstr "Notes personnelles" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "Notes personnelles" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "Sujet de cours" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -227,7 +229,7 @@ msgstr "Sujet de cours" msgid "Homework" msgstr "Devoirs" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 @@ -236,32 +238,32 @@ msgstr "Devoirs" msgid "Group note" msgstr "Groupe" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "Documentation de cours" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 #, fuzzy #| msgid "Lesson documentation" msgid "Lesson documentations" msgstr "Documentation de cours" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "" -#: models.py:223 +#: models.py:209 #, fuzzy #| msgid "Register absence" msgid "Can register absence" msgstr "Registre de Absence" -#: models.py:224 +#: models.py:210 #, fuzzy #| msgid "List of all personal note filters" msgid "Can list all personal note filters" @@ -287,7 +289,7 @@ msgstr "" msgid "This will carry over data only if the data in the following periods are empty." msgstr "" -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "" @@ -316,6 +318,56 @@ msgstr "Registre de Absence" msgid "Person" msgstr "Personne" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +#, fuzzy +#| msgid "Register absence" +msgid "Confirm: Register absence" +msgstr "Registre de Absence" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:42 +#, fuzzy +#| msgid "" +#| "\n" +#| " There are no lessons for the selected group, teacher, room or time.\n" +#| " " +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" +"\n" +" Il n' y a pas des cours pour le groupe sélectionné, les profs, le salle ou le temps.\n" +" " + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "" @@ -897,67 +949,67 @@ msgstr "Documentation de cours pour la semaine calendrier" msgid "Notes" msgstr "Notes" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "" -#: views.py:133 +#: views.py:127 #, fuzzy #| msgid "Lesson documentation for calendar week" msgid "The lesson documentation has been saved." msgstr "Documentation de cours pour la semaine calendrier" -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "" -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "" -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "" -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "" -#: views.py:754 +#: views.py:741 #, fuzzy #| msgid "Lesson documentation for calendar week" msgid "The personal note has been deleted." msgstr "Documentation de cours pour la semaine calendrier" -#: views.py:775 +#: views.py:762 #, fuzzy #| msgid "Lesson documentation for calendar week" msgid "The extra mark has been created." msgstr "Documentation de cours pour la semaine calendrier" -#: views.py:786 +#: views.py:773 #, fuzzy #| msgid "Lesson documentation for calendar week" msgid "The extra mark has been saved." msgstr "Documentation de cours pour la semaine calendrier" -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "" -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "" -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "" -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "" diff --git a/aleksis/apps/alsijil/locale/la/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/la/LC_MESSAGES/django.po index 9e7d29cdecf99e25af3f8af0420a8b06ce1b7e72..053c32a5484cf531503f41a76d6e56ff51bcd59c 100644 --- a/aleksis/apps/alsijil/locale/la/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/la/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" "PO-Revision-Date: 2020-07-26 14:08+0000\n" "Last-Translator: Julian <leuckerj@gmail.com>\n" "Language-Team: Latin <https://translate.edugit.org/projects/aleksis/aleksis-app-alsijil/la/>\n" @@ -36,23 +36,24 @@ msgstr "" msgid "You can't select a group and a teacher both." msgstr "" -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "" -#: forms.py:127 +#: forms.py:128 msgid "Start period" msgstr "" -#: forms.py:128 +#: forms.py:129 msgid "End period" msgstr "" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -60,7 +61,8 @@ msgstr "" msgid "Absent" msgstr "" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -71,13 +73,13 @@ msgstr "" msgid "Excused" msgstr "" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 msgid "Excuse type" msgstr "" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -111,13 +113,13 @@ msgstr "" msgid "My students" msgstr "" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 msgid "Excuse types" msgstr "" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -127,19 +129,19 @@ msgstr "" msgid "Extra marks" msgstr "" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "" -#: model_extensions.py:152 +#: model_extensions.py:155 msgid "Can view all personal notes of a group" msgstr "" -#: model_extensions.py:155 +#: model_extensions.py:156 msgid "Can edit all personal notes of a group" msgstr "" @@ -159,47 +161,47 @@ msgstr "" msgid "Can register an absence for all members of a group" msgstr "" -#: model_extensions.py:168 +#: model_extensions.py:167 msgid "Can register an absence for a person" msgstr "" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 #, fuzzy #| msgid "First name" msgid "Short name" msgstr "Primus nomen" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "" -#: models.py:111 +#: models.py:101 #, fuzzy #| msgid "Person" msgid "Personal note" msgstr "Persona" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -207,7 +209,7 @@ msgstr "" msgid "Homework" msgstr "" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 @@ -216,28 +218,28 @@ msgstr "" msgid "Group note" msgstr "Grex" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 msgid "Lesson documentations" msgstr "" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "" -#: models.py:223 +#: models.py:209 msgid "Can register absence" msgstr "" -#: models.py:224 +#: models.py:210 msgid "Can list all personal note filters" msgstr "" @@ -261,7 +263,7 @@ msgstr "" msgid "This will carry over data only if the data in the following periods are empty." msgstr "" -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "" @@ -290,6 +292,46 @@ msgstr "" msgid "Person" msgstr "Persona" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +msgid "Confirm: Register absence" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:42 +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "" @@ -836,59 +878,59 @@ msgstr "" msgid "Notes" msgstr "" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "" -#: views.py:133 +#: views.py:127 msgid "The lesson documentation has been saved." msgstr "" -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "" -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "" -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "" -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "" -#: views.py:754 +#: views.py:741 msgid "The personal note has been deleted." msgstr "" -#: views.py:775 +#: views.py:762 msgid "The extra mark has been created." msgstr "" -#: views.py:786 +#: views.py:773 msgid "The extra mark has been saved." msgstr "" -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "" -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "" -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "" -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "" diff --git a/aleksis/apps/alsijil/locale/nb_NO/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/nb_NO/LC_MESSAGES/django.po index 3133277a307b8c1cf68500bde39fe4512feba932..219d7af7ff7ca661ccb440d5fab0002ecb546788 100644 --- a/aleksis/apps/alsijil/locale/nb_NO/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/nb_NO/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -35,23 +35,24 @@ msgstr "" msgid "You can't select a group and a teacher both." msgstr "" -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "" -#: forms.py:127 +#: forms.py:128 msgid "Start period" msgstr "" -#: forms.py:128 +#: forms.py:129 msgid "End period" msgstr "" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -59,7 +60,8 @@ msgstr "" msgid "Absent" msgstr "" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -70,13 +72,13 @@ msgstr "" msgid "Excused" msgstr "" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 msgid "Excuse type" msgstr "" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -108,13 +110,13 @@ msgstr "" msgid "My students" msgstr "" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 msgid "Excuse types" msgstr "" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -124,19 +126,19 @@ msgstr "" msgid "Extra marks" msgstr "" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "" -#: model_extensions.py:152 +#: model_extensions.py:155 msgid "Can view all personal notes of a group" msgstr "" -#: model_extensions.py:155 +#: model_extensions.py:156 msgid "Can edit all personal notes of a group" msgstr "" @@ -156,43 +158,43 @@ msgstr "" msgid "Can register an absence for all members of a group" msgstr "" -#: model_extensions.py:168 +#: model_extensions.py:167 msgid "Can register an absence for a person" msgstr "" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 msgid "Short name" msgstr "" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "" -#: models.py:111 +#: models.py:101 msgid "Personal note" msgstr "" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -200,35 +202,35 @@ msgstr "" msgid "Homework" msgstr "" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 msgid "Group note" msgstr "" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 msgid "Lesson documentations" msgstr "" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "" -#: models.py:223 +#: models.py:209 msgid "Can register absence" msgstr "" -#: models.py:224 +#: models.py:210 msgid "Can list all personal note filters" msgstr "" @@ -252,7 +254,7 @@ msgstr "" msgid "This will carry over data only if the data in the following periods are empty." msgstr "" -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "" @@ -281,6 +283,46 @@ msgstr "" msgid "Person" msgstr "" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +msgid "Confirm: Register absence" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:42 +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "" @@ -823,58 +865,58 @@ msgstr "" msgid "Notes" msgstr "" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "" -#: views.py:133 +#: views.py:127 msgid "The lesson documentation has been saved." msgstr "" -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "" -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "" -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "" -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "" -#: views.py:754 +#: views.py:741 msgid "The personal note has been deleted." msgstr "" -#: views.py:775 +#: views.py:762 msgid "The extra mark has been created." msgstr "" -#: views.py:786 +#: views.py:773 msgid "The extra mark has been saved." msgstr "" -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "" -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "" -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "" -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "" diff --git a/aleksis/apps/alsijil/locale/tr_TR/LC_MESSAGES/django.po b/aleksis/apps/alsijil/locale/tr_TR/LC_MESSAGES/django.po index 3133277a307b8c1cf68500bde39fe4512feba932..219d7af7ff7ca661ccb440d5fab0002ecb546788 100644 --- a/aleksis/apps/alsijil/locale/tr_TR/LC_MESSAGES/django.po +++ b/aleksis/apps/alsijil/locale/tr_TR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-14 12:23+0100\n" +"POT-Creation-Date: 2020-12-05 21:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -35,23 +35,24 @@ msgstr "" msgid "You can't select a group and a teacher both." msgstr "" -#: forms.py:125 +#: forms.py:126 msgid "Start date" msgstr "" -#: forms.py:126 +#: forms.py:127 msgid "End date" msgstr "" -#: forms.py:127 +#: forms.py:128 msgid "Start period" msgstr "" -#: forms.py:128 +#: forms.py:129 msgid "End period" msgstr "" -#: forms.py:129 templates/alsijil/class_register/lesson.html:243 +#: forms.py:130 templates/alsijil/absences/register_confirm.html:52 +#: templates/alsijil/class_register/lesson.html:243 #: templates/alsijil/class_register/person.html:207 #: templates/alsijil/class_register/week_view.html:261 #: templates/alsijil/print/full_register.html:75 @@ -59,7 +60,8 @@ msgstr "" msgid "Absent" msgstr "" -#: forms.py:130 templates/alsijil/class_register/lesson.html:245 +#: forms.py:131 templates/alsijil/absences/register_confirm.html:56 +#: templates/alsijil/class_register/lesson.html:245 #: templates/alsijil/class_register/person.html:98 #: templates/alsijil/class_register/person.html:215 #: templates/alsijil/partials/mark_as_buttons.html:2 @@ -70,13 +72,13 @@ msgstr "" msgid "Excused" msgstr "" -#: forms.py:132 models.py:41 models.py:74 +#: forms.py:133 models.py:37 models.py:64 #: templates/alsijil/class_register/lesson.html:246 #: templates/alsijil/class_register/lesson.html:281 msgid "Excuse type" msgstr "" -#: forms.py:137 templates/alsijil/class_register/lesson.html:248 +#: forms.py:138 templates/alsijil/class_register/lesson.html:248 #: templates/alsijil/class_register/lesson.html:302 #: templates/alsijil/print/full_register.html:314 msgid "Remarks" @@ -108,13 +110,13 @@ msgstr "" msgid "My students" msgstr "" -#: menus.py:71 models.py:42 templates/alsijil/excuse_type/list.html:8 +#: menus.py:71 models.py:38 templates/alsijil/excuse_type/list.html:8 #: templates/alsijil/excuse_type/list.html:9 #: templates/alsijil/partials/legend.html:26 msgid "Excuse types" msgstr "" -#: menus.py:82 models.py:80 models.py:215 +#: menus.py:82 models.py:70 models.py:201 #: templates/alsijil/class_register/lesson.html:247 #: templates/alsijil/extra_mark/list.html:8 #: templates/alsijil/extra_mark/list.html:9 @@ -124,19 +126,19 @@ msgstr "" msgid "Extra marks" msgstr "" -#: model_extensions.py:145 +#: model_extensions.py:150 msgid "Can view week overview of group class register" msgstr "" -#: model_extensions.py:149 +#: model_extensions.py:153 msgid "Can view lesson overview of group class register" msgstr "" -#: model_extensions.py:152 +#: model_extensions.py:155 msgid "Can view all personal notes of a group" msgstr "" -#: model_extensions.py:155 +#: model_extensions.py:156 msgid "Can edit all personal notes of a group" msgstr "" @@ -156,43 +158,43 @@ msgstr "" msgid "Can register an absence for all members of a group" msgstr "" -#: model_extensions.py:168 +#: model_extensions.py:167 msgid "Can register an absence for a person" msgstr "" -#: models.py:28 models.py:201 +#: models.py:25 models.py:188 msgid "Short name" msgstr "" -#: models.py:30 models.py:203 templates/alsijil/class_register/groups.html:20 +#: models.py:26 models.py:189 templates/alsijil/class_register/groups.html:20 #: templates/alsijil/partials/persons_with_stats.html:14 #: templates/alsijil/partials/persons_with_stats.html:24 msgid "Name" msgstr "" -#: models.py:60 models.py:131 +#: models.py:54 models.py:121 msgid "Year" msgstr "" -#: models.py:111 +#: models.py:101 msgid "Personal note" msgstr "" -#: models.py:112 templates/alsijil/class_register/lesson.html:101 +#: models.py:102 templates/alsijil/class_register/lesson.html:101 #: templates/alsijil/class_register/lesson.html:233 #: templates/alsijil/class_register/week_view.html:68 #: templates/alsijil/class_register/week_view.html:242 msgid "Personal notes" msgstr "" -#: models.py:137 templates/alsijil/class_register/lesson.html:129 +#: models.py:127 templates/alsijil/class_register/lesson.html:129 #: templates/alsijil/class_register/week_view.html:90 #: templates/alsijil/class_register/week_view.html:177 #: templates/alsijil/print/full_register.html:371 msgid "Lesson topic" msgstr "" -#: models.py:138 templates/alsijil/class_register/lesson.html:137 +#: models.py:128 templates/alsijil/class_register/lesson.html:137 #: templates/alsijil/class_register/week_view.html:91 #: templates/alsijil/class_register/week_view.html:183 #: templates/alsijil/class_register/week_view.html:216 @@ -200,35 +202,35 @@ msgstr "" msgid "Homework" msgstr "" -#: models.py:140 templates/alsijil/class_register/lesson.html:145 +#: models.py:129 templates/alsijil/class_register/lesson.html:145 #: templates/alsijil/class_register/week_view.html:92 #: templates/alsijil/class_register/week_view.html:189 #: templates/alsijil/class_register/week_view.html:222 msgid "Group note" msgstr "" -#: models.py:183 templates/alsijil/class_register/lesson.html:97 +#: models.py:171 templates/alsijil/class_register/lesson.html:97 #: templates/alsijil/class_register/lesson.html:120 msgid "Lesson documentation" msgstr "" -#: models.py:184 templates/alsijil/class_register/week_view.html:67 +#: models.py:172 templates/alsijil/class_register/week_view.html:67 msgid "Lesson documentations" msgstr "" -#: models.py:214 +#: models.py:200 msgid "Extra mark" msgstr "" -#: models.py:222 +#: models.py:208 msgid "Can view week overview" msgstr "" -#: models.py:223 +#: models.py:209 msgid "Can register absence" msgstr "" -#: models.py:224 +#: models.py:210 msgid "Can list all personal note filters" msgstr "" @@ -252,7 +254,7 @@ msgstr "" msgid "This will carry over data only if the data in the following periods are empty." msgstr "" -#: preferences.py:56 +#: preferences.py:55 msgid "Allow teachers to open lesson periods on the same day and not just at the beginning of the period" msgstr "" @@ -281,6 +283,46 @@ msgstr "" msgid "Person" msgstr "" +#: templates/alsijil/absences/register_confirm.html:5 +#: templates/alsijil/absences/register_confirm.html:6 +msgid "Confirm: Register absence" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:10 +msgid "" +"\n" +" Do you really want to register the following absence?\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:27 +msgid "" +"\n" +" As the length of this absence is longer than one day,\n" +" please double check the correctness of your entry.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:37 +#, python-format +msgid " %(count)s affected lessons " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:42 +msgid "" +"\n" +" There are no affected lessons. Registering this absence won't have any effect.\n" +" " +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:59 +msgid "Reset status to 'not absent'" +msgstr "" + +#: templates/alsijil/absences/register_confirm.html:81 +msgid "Cancel" +msgstr "" + #: templates/alsijil/class_register/groups.html:21 msgid "Students" msgstr "" @@ -823,58 +865,58 @@ msgstr "" msgid "Notes" msgstr "" -#: views.py:69 +#: views.py:65 msgid "You either selected an invalid lesson or there is currently no lesson in progress." msgstr "" -#: views.py:95 +#: views.py:90 msgid "You are not allowed to create a lesson documentation for a lesson in the future." msgstr "" -#: views.py:133 +#: views.py:127 msgid "The lesson documentation has been saved." msgstr "" -#: views.py:156 +#: views.py:151 msgid "The personal notes have been saved." msgstr "" -#: views.py:587 +#: views.py:570 msgid "The absences have been marked as excused." msgstr "" -#: views.py:605 +#: views.py:585 msgid "The absence has been marked as excused." msgstr "" -#: views.py:735 +#: views.py:721 msgid "The absence has been saved." msgstr "" -#: views.py:754 +#: views.py:741 msgid "The personal note has been deleted." msgstr "" -#: views.py:775 +#: views.py:762 msgid "The extra mark has been created." msgstr "" -#: views.py:786 +#: views.py:773 msgid "The extra mark has been saved." msgstr "" -#: views.py:796 +#: views.py:783 msgid "The extra mark has been deleted." msgstr "" -#: views.py:816 +#: views.py:803 msgid "The excuse type has been created." msgstr "" -#: views.py:827 +#: views.py:814 msgid "The excuse type has been saved." msgstr "" -#: views.py:837 +#: views.py:824 msgid "The excuse type has been deleted." msgstr "" diff --git a/aleksis/apps/alsijil/model_extensions.py b/aleksis/apps/alsijil/model_extensions.py index 820a58c82b140e026e4a3e62ffda73e96ea2cbfb..7ab840196988b80bffa63c9c4d3a5aa20aedffef 100644 --- a/aleksis/apps/alsijil/model_extensions.py +++ b/aleksis/apps/alsijil/model_extensions.py @@ -26,12 +26,18 @@ def mark_absent( excuse_type: Optional[ExcuseType] = None, remarks: str = "", to_period: Optional[int] = None, + dry_run: bool = False, ): """Mark a person absent for all lessons in a day, optionally starting with a selected period number. This function creates `PersonalNote` objects for every `LessonPeriod` the person participates in on the selected day and marks them as absent/excused. + :param dry_run: With this activated, the function won't change any data + and just return the count of affected lessons + + :return: Count of affected lesson periods + ..note:: Only available when AlekSIS-App-Alsijil is installed. :Date: 2019-11-10 @@ -51,32 +57,39 @@ def mark_absent( lesson_periods = lesson_periods.filter(period__period__lte=to_period) # Create and update all personal notes for the discovered lesson periods - for lesson_period in lesson_periods: - sub = lesson_period.get_substitution() - if sub and sub.cancelled: - continue - - with reversion.create_revision(): - set_user(get_request().user) - personal_note, created = ( - PersonalNote.objects.select_related(None) - .prefetch_related(None) - .update_or_create( - person=self, - lesson_period=lesson_period, - week=wanted_week.week, - year=wanted_week.year, - defaults={"absent": absent, "excused": excused, "excuse_type": excuse_type,}, + if not dry_run: + for lesson_period in lesson_periods: + sub = lesson_period.get_substitution() + if sub and sub.cancelled: + continue + + with reversion.create_revision(): + set_user(get_request().user) + personal_note, created = ( + PersonalNote.objects.select_related(None) + .prefetch_related(None) + .update_or_create( + person=self, + lesson_period=lesson_period, + week=wanted_week.week, + year=wanted_week.year, + defaults={ + "absent": absent, + "excused": excused, + "excuse_type": excuse_type, + }, + ) ) - ) - personal_note.groups_of_person.set(self.member_of.all()) - - if remarks: - if personal_note.remarks: - personal_note.remarks += "; %s" % remarks - else: - personal_note.remarks = remarks - personal_note.save() + personal_note.groups_of_person.set(self.member_of.all()) + + if remarks: + if personal_note.remarks: + personal_note.remarks += "; %s" % remarks + else: + personal_note.remarks = remarks + personal_note.save() + + return lesson_periods.count() @LessonPeriod.method diff --git a/aleksis/apps/alsijil/preferences.py b/aleksis/apps/alsijil/preferences.py index 07ed2153a26e8b5af09131dc464b9d6ab4f7b74e..4ced04f41ba56db628b4dc4438242a81bc36f5eb 100644 --- a/aleksis/apps/alsijil/preferences.py +++ b/aleksis/apps/alsijil/preferences.py @@ -58,3 +58,11 @@ class AllowOpenPeriodsOnSameDay(BooleanPreference): help_text = _( "Lessons in the past are not affected by this setting, you can open them whenever you want." ) + + +@site_preferences_registry.register +class AllowEntriesInHolidays(BooleanPreference): + section = alsijil + name = "allow_entries_in_holidays" + default = False + verbose_name = _("Allow teachers to add data for lessons in holidays") diff --git a/aleksis/apps/alsijil/templates/alsijil/absences/register_confirm.html b/aleksis/apps/alsijil/templates/alsijil/absences/register_confirm.html new file mode 100644 index 0000000000000000000000000000000000000000..449276cdc9781d2a5760e823e882e7582292eac9 --- /dev/null +++ b/aleksis/apps/alsijil/templates/alsijil/absences/register_confirm.html @@ -0,0 +1,84 @@ +{# -*- engine:django -*- #} +{% extends "core/base.html" %} +{% load material_form i18n static %} + +{% block browser_title %}{% blocktrans %}Confirm: Register absence{% endblocktrans %}{% endblock %} +{% block page_title %}{% blocktrans %}Confirm: Register absence{% endblocktrans %}{% endblock %} + +{% block content %} + <p class="flow-text"> + {% blocktrans %} + Do you really want to register the following absence? + {% endblocktrans %} + </p> + <div class="card"> + <div class="card-content"> + <div class="card-title"> + {{ person }} + </div> + <div class="collection"> + <div class="collection-item"> + <i class="material-icons left">date_range</i> + {{ form_data.date_start }}, {{ form_data.from_period }}. – {{ form_data.date_end }}, {{ form_data.to_period }}. + {% if form_data.date_start != form_data.date_end %} + <div class="alert warning"> + <div> + <i class="material-icons left">warning</i> + {% blocktrans %} + As the length of this absence is longer than one day, + please double check the correctness of your entry. + {% endblocktrans %} + </div> + </div> + {% endif %} + </div> + <div class="collection-item"> + <i class="material-icons left">list</i> + {% blocktrans with count=affected_lessons %} {{ count }} affected lessons {% endblocktrans %} + {% if affected_lessons == 0 %} + <div class="alert error"> + <div> + <i class="material-icons left">error</i> + {% blocktrans %} + There are no affected lessons. Registering this absence won't have any effect. + {% endblocktrans %} + </div> + </div> + {% endif %} + </div> + <div class="collection-item"> + <i class="material-icons left">label</i> + {% if form_data.absent %} + <span class="chip red white-text">{% trans "Absent" %}</span> + {% if form_data.excused and form_data.excuse_type %} + <span class="chip green white-text">{{ form_data.excuse_type.name }}</span> + {% elif form_data.excused %} + <span class="chip green white-text">{% trans "Excused" %}</span> + {% endif %} + {% else %} + {% trans "Reset status to 'not absent'" %} + {% endif %} + </div> + {% if form_data.remarks %} + <div class="collection-item"> + <i class="material-icons left">edit</i> + {{ form_data.remarks }} + </div> + {% endif %} + </div> + </div> + </div> + + <form method="post"> + {% csrf_token %} + <div class="hide"> + {% form form=form %}{% endform %} + </div> + <input type="hidden" name="confirmed" value="1"> + {% include "core/partials/save_button.html" %} + <a class="btn red waves-effect waves-light" href="{% url "register_absence" person.pk %}"> + <i class="material-icons left">cancel</i> + {% trans "Cancel" %} + </a> + </form> +{% endblock %} diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/lesson.html b/aleksis/apps/alsijil/templates/alsijil/class_register/lesson.html index 52462d6947cbee249502a04528f8469dbece41ef..23c96614dba54513c8c8dc4d033fd10cdc2665d6 100644 --- a/aleksis/apps/alsijil/templates/alsijil/class_register/lesson.html +++ b/aleksis/apps/alsijil/templates/alsijil/class_register/lesson.html @@ -67,8 +67,10 @@ <form method="post" class="row"> <p> - {% if can_edit_lesson_documentation or can_edit_lesson_personalnote %} - {% include "core/partials/save_button.html" %} + {% if not blocked_because_holidays %} + {% if can_edit_lesson_documentation or can_edit_lesson_personalnote %} + {% include "core/partials/save_button.html" %} + {% endif %} {% endif %} <a class="btn waves-effect waves-light primary" @@ -90,284 +92,307 @@ {% csrf_token %} - <div class="row"> - <div class="col s12"> - <ul class="tabs"> - <li class="tab"> - <a href="#lesson-documentation">{% trans "Lesson documentation" %}</a> - </li> - {% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %} + {% if not blocked_because_holidays %} + + <div class="row"> + <div class="col s12"> + <ul class="tabs"> <li class="tab"> - <a href="#personal-notes">{% trans "Personal notes" %}</a> + <a href="#lesson-documentation">{% trans "Lesson documentation" %}</a> </li> - {% endif %} - {% has_perm "alsijil.view_lessondocumentation" user lesson_period.prev as can_view_prev_lesson_documentation %} - {% if lesson_period.prev.get_lesson_documentation and can_view_prev_lesson_documentation %} + {% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %} + <li class="tab"> + <a href="#personal-notes">{% trans "Personal notes" %}</a> + </li> + {% endif %} + {% has_perm "alsijil.view_lessondocumentation" user lesson_period.prev as can_view_prev_lesson_documentation %} + {% if lesson_period.prev.get_lesson_documentation and can_view_prev_lesson_documentation %} + <li class="tab"> + <a href="#previous-lesson">{% trans "Previous lesson" %}</a> + </li> + {% endif %} <li class="tab"> - <a href="#previous-lesson">{% trans "Previous lesson" %}</a> + <a href="#version-history">{% trans "Change history" %}</a> </li> - {% endif %} - <li class="tab"> - <a href="#version-history">{% trans "Change history" %}</a> - </li> - </ul> - </div> - - <div class="col s12" id="lesson-documentation"> - <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> + </ul> </div> - </div> - - {% with prev_lesson=lesson_period.prev prev_doc=prev_lesson.get_lesson_documentation %} - {% with absences=prev_lesson.get_absences tardinesses=prev_lesson.get_tardinesses extra_marks=prev_lesson.get_extra_marks %} - {% has_perm "alsijil.view_lessondocumentation" user prev_lesson as can_view_prev_lesson_documentation %} - {% if prev_doc and can_view_prev_lesson_documentation %} - {% weekday_to_date prev_lesson.week prev_lesson.period.weekday as prev_date %} - <div class="col s12" id="previous-lesson"> - <div class="card"> - <div class="card-content"> - <span class="card-title"> - {% blocktrans %}Overview: Previous lesson{% endblocktrans %} ({{ prev_date }}, - {% 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" 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> - </div> - {% endif %} - {% endwith %} - {% endwith %} - - {% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %} - <div class="col s12" id="personal-notes"> + <div class="col s12" id="lesson-documentation"> <div class="card"> <div class="card-content"> <span class="card-title"> - {% blocktrans %}Personal notes{% endblocktrans %} + {% blocktrans %}Lesson documentation{% endblocktrans %} </span> - {% if can_edit_lesson_personalnote %} - {% form form=personal_note_formset.management_form %}{% endform %} + + {% 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> + </div> - <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_lesson_personalnote %} - <tr> - {{ form.id }} - <td>{{ form.person_name }}{{ form.person_name.value }}</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)" %} + {% with prev_lesson=lesson_period.prev prev_doc=prev_lesson.get_lesson_documentation %} + {% with absences=prev_lesson.get_absences tardinesses=prev_lesson.get_tardinesses extra_marks=prev_lesson.get_extra_marks %} + {% has_perm "alsijil.view_lessondocumentation" user prev_lesson as can_view_prev_lesson_documentation %} + {% if prev_doc and can_view_prev_lesson_documentation %} + {% weekday_to_date prev_lesson.week prev_lesson.period.weekday as prev_date %} + <div class="col s12" id="previous-lesson"> + <div class="card"> + <div class="card-content"> + <span class="card-title"> + {% blocktrans %}Overview: Previous lesson{% endblocktrans %} ({{ prev_date }}, + {% 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" 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> + </div> + {% endif %} + {% endwith %} + {% endwith %} + + {% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %} + <div class="col s12" id="personal-notes"> + <div class="card"> + <div class="card-content"> + <span class="card-title"> + {% blocktrans %}Personal notes{% endblocktrans %} + </span> + {% if can_edit_lesson_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_lesson_personalnote %} + <tr> + {{ form.id }} + <td>{{ form.person_name }}{{ form.person_name.value }}</td> + <td class="center-align"> + <label> + {{ form.absent }} + <span></span> </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" %} + </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> - </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> + </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 %} - {% endfor %} - </td> - <td> - <div class="input-field"> - {{ form.remarks }} - <label for="{{ form.absent.id_for_label }}"> - {% trans "Remarks" %} - </label> - </div> - </td> - </tr> - {% else %} - <tr> - <td>{{ form.person_name.value }}</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"> + </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 }}</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> + </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> </div> - </div> - {% endif %} + {% endif %} - {% if can_view_lesson_documentation %} - <div class="col s12" id="version-history"> - <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 %} + {% if can_view_lesson_documentation %} + <div class="col s12" id="version-history"> + <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> </div> - </div> - {% endif %} - </div> + {% endif %} + </div> - <p> - {% if can_edit_lesson_documentation or can_edit_lesson_personalnote %} - {% include "core/partials/save_button.html" %} - {% endif %} - <a class="btn primary waves-effect waves-light" - href="{% url "lesson_by_week_and_period" prev_lesson.week.year prev_lesson.week.week prev_lesson.id %}"> - <i class="material-icons left">arrow_back</i> - {% blocktrans with subject=lesson_period.get_subject.name %} - Previous {{ subject }} lesson - {% endblocktrans %} - </a> + <p> + {% if can_edit_lesson_documentation or can_edit_lesson_personalnote %} + {% include "core/partials/save_button.html" %} + {% endif %} - <a class="btn primary right waves-effect waves-light" - href="{% url "lesson_by_week_and_period" next_lesson.week.year next_lesson.week.week next_lesson.id %}"> - <i class="material-icons right">arrow_forward</i> - {% blocktrans with subject=lesson_period.get_subject.name %} - Next {{ subject }} lesson - {% endblocktrans %} - </a> - </p> + <a class="btn primary waves-effect waves-light" + href="{% url "lesson_by_week_and_period" prev_lesson.week.year prev_lesson.week.week prev_lesson.id %}"> + <i class="material-icons left">arrow_back</i> + {% blocktrans with subject=lesson_period.get_subject.name %} + Previous {{ subject }} lesson + {% endblocktrans %} + </a> + + <a class="btn primary right waves-effect waves-light" + href="{% url "lesson_by_week_and_period" next_lesson.week.year next_lesson.week.week next_lesson.id %}"> + <i class="material-icons right">arrow_forward</i> + {% blocktrans with subject=lesson_period.get_subject.name %} + Next {{ subject }} lesson + {% endblocktrans %} + </a> + </p> + + {% else %} + <div class="row no-margin"> + <div class="container"> + <div class="card"> + <div class="card-content center-align"> + <p> + <i class="material-icons medium orange-text">warning</i> + </p> + <p class="card-title"> + {% blocktrans %} + This lesson overlaps with holidays and can't be edited. + {% endblocktrans %} + </p> + <span class="badge new blue no-float no-margin">{{ holiday }}</span> + </div> + </div> + </div> + </div> + {% endif %} </form> {% endblock %} diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html index 826d5b8fe8a5d5159adb996e6bc0f46e2dce0d9a..259b7b3471c1508f08b29188e5e4a578204db8f2 100644 --- a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html +++ b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html @@ -74,7 +74,7 @@ </li> {% empty %} <li class="collection-item avatar valign-wrapper"> - <i class="material-icons left circle green white-text">check</i> + <i class="material-icons left materialize-circle green white-text">check</i> <span class="title">{% trans "There are no unexcused lessons." %}</span> </li> {% endfor %} diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html b/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html index ac9cee7584efcf65263f78ea8a8cdf1933aa6f7d..0f55e11eaeffe87ca49564074b10cbbae1acc398 100644 --- a/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html +++ b/aleksis/apps/alsijil/templates/alsijil/class_register/week_view.html @@ -64,175 +64,200 @@ <div class="row"> <div class="col s12"> <ul class="tabs"> - <li class="tab col s6"><a class="active" href="#week-overview">{% trans "Lesson documentations" %}</a></li> - <li class="tab col s6"><a class="active" href="#personal-notes">{% trans "Personal notes" %}</a></li> + <li class="tab col s6"> + <a class="active" href="#week-overview">{% trans "Lesson documentations" %}</a> + </li> + <li class="tab col s6"> + <a class="active" href="#personal-notes">{% trans "Personal notes" %}</a> + </li> </ul> </div> <div class="col s12" id="week-overview"> {% regroup lesson_periods by period.get_weekday_display as periods_by_day %} {% for weekday, periods in periods_by_day %} - <div class="card show-on-extra-large"> - <div class="card-content"> - {% weekday_to_date week periods.0.period.weekday as current_date %} - <span class="card-title"> - {{ weekday }}, {{ current_date }} - </span> - <table class="striped datatable"> - <thead> - <tr> - <th></th> - <th>{% blocktrans %}Period{% endblocktrans %}</th> - {% if not group %} - <th>{% blocktrans %}Groups{% endblocktrans %}</th> - {% endif %} - <th>{% blocktrans %}Subject{% endblocktrans %}</th> - <th>{% blocktrans %}Teachers{% endblocktrans %}</th> - <th>{% blocktrans %}Lesson topic{% endblocktrans %}</th> - <th>{% blocktrans %}Homework{% endblocktrans %}</th> - <th>{% blocktrans %}Group note{% endblocktrans %}</th> - </tr> - </thead> - <tbody> - {% for period in periods %} - {% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %} - {% if can_view_lesson_documentation %} + {% with weekdays|get_dict:forloop.counter0 as advanced_weekday %} + {% weekday_to_date week periods.0.period.weekday as current_date %} + + {% if advanced_weekday.holiday and not request.site.preferences.alsijil__allow_entries_in_holidays %} + <div class="card"> + <div class="card-content"> + {% weekday_to_date week periods.0.period.weekday as current_date %} + <span class="card-title"> + {{ weekday }}, {{ current_date }} <span class="badge new blue no-float">{{ advanced_weekday.holiday }}</span> + </span> + </div> + </div> + {% else %} + <div class="card show-on-extra-large"> + <div class="card-content"> + <span class="card-title"> + {{ weekday }}, {{ current_date }} + </span> + <table class="striped datatable"> + <thead> <tr> - <td class="center-align"> - {% include "alsijil/partials/lesson_status_icon.html" with period=period %} - </td> - <td class="tr-link"> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {{ period.period.period }}. - </a> - </td> + <th></th> + <th>{% blocktrans %}Period{% endblocktrans %}</th> {% if not group %} - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {{ period.lesson.group_names }} - </a> - </td> + <th>{% blocktrans %}Groups{% endblocktrans %}</th> {% endif %} - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {{ period.get_subject.name }} - </a> - </td> - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {{ period.get_teacher_names }} - </a> - </td> - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {% firstof period.get_lesson_documentation.topic "–" %} - </a> - </td> - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {% firstof period.get_lesson_documentation.homework "–" %} - </a> - </td> - <td> - <a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {% firstof period.get_lesson_documentation.group_note "–" %} - </a> - </td> + <th>{% blocktrans %}Subject{% endblocktrans %}</th> + <th>{% blocktrans %}Teachers{% endblocktrans %}</th> + <th>{% blocktrans %}Lesson topic{% endblocktrans %}</th> + <th>{% blocktrans %}Homework{% endblocktrans %}</th> + <th>{% blocktrans %}Group note{% endblocktrans %}</th> </tr> - {% endif %} - {% endfor %} - </tbody> - </table> - </div> - </div> - <ul class="collapsible hide-on-extra-large-only"> - <li class=""> - {% weekday_to_date week periods.0.period.weekday as current_date %} - <div class="collapsible-header flow-text"> - {{ weekday }}, {{ current_date }} <i class="material-icons collapsible-icon-right">expand_more</i> - </div> - <div class="collapsible-body"> - <div class="collection"> - {% for period in periods %} - {% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %} - {% if can_view_lesson_documentation %} - <a class="collection-item avatar" - href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> - {% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="circle" color_suffix=" " %} - <table class="hide-on-med-and-down"> - <tr> - <th>{% trans "Subject" %}</th> - <td>{{ period.period.period }}. {{ period.get_subject.name }}</td> - </tr> + </thead> + <tbody> + {% for period in periods %} + {% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %} + {% if can_view_lesson_documentation %} + <tr> + <td class="center-align"> + {% include "alsijil/partials/lesson_status_icon.html" with period=period %} + </td> + <td class="tr-link"> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {{ period.period.period }}. + </a> + </td> {% if not group %} - <tr> - <th>{% trans "Group" %}</th> - <td>{{ period.lesson.group_names }}</td> - </tr> - {% endif %} - <tr> - <th>{% trans "Teachers" %}</th> - <td>{{ period.lesson.teacher_names }}</td> - </tr> - <tr> - <th>{% trans "Lesson topic" %}</th> - <td>{% firstof period.get_lesson_documentation.topic "–" %}</td> - </tr> - {% with period.get_lesson_documentation as lesson_documentation %} - {% if lesson_documentation.homework %} - <tr> - <th>{% trans "Homework" %}</th> - <td>{% firstof period.get_lesson_documentation.homework "–" %}</td> - </tr> - {% endif %} - {% if lesson_documentation.group_note %} - <tr> - <th>{% trans "Group note" %}</th> - <td>{% firstof period.get_lesson_documentation.group_note "–" %}</td> - </tr> - {% endif %} - {% endwith %} - </table> - <div class="hide-on-large-only"> - <ul class="collection"> - <li class="collection-item"> - {{ period.period.period }}. {{ period.get_subject.name }} - </li> - {% if not group %} - <li class="collection-item"> - + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> {{ period.lesson.group_names }} - - </li> - {% endif %} - <li class="collection-item"> - {{ period.lesson.teacher_names }} - </li> - <li class="collection-item"> - {{ period.get_lesson_documentation.topic }} - </li> - {% with period.get_lesson_documentation as lesson_documentation %} - {% if lesson_documentation.homework %} - <li class="collection-item"> - <strong>{% trans "Homework" %}</strong> - {% firstof period.get_lesson_documentation.homework "–" %} - </li> - {% endif %} - {% if lesson_documentation.group_note %} - <li class="collection-item"> - <strong>{% trans "Group note" %}</strong> - {% firstof period.get_lesson_documentation.group_note "–" %} - </li> - {% endif %} - {% endwith %} - </ul> - </div> - </a> - {% endif %} - {% endfor %} + </a> + </td> + {% endif %} + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {{ period.get_subject.name }} + </a> + </td> + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {{ period.get_teacher_names }} + </a> + </td> + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {% firstof period.get_lesson_documentation.topic "–" %} + </a> + </td> + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {% firstof period.get_lesson_documentation.homework "–" %} + </a> + </td> + <td> + <a class="tr-link" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {% firstof period.get_lesson_documentation.group_note "–" %} + </a> + </td> + </tr> + {% endif %} + {% endfor %} + </tbody> + </table> </div> </div> - </li> - </ul> + <ul class="collapsible hide-on-extra-large-only"> + <li class=""> + {% weekday_to_date week periods.0.period.weekday as current_date %} + <div class="collapsible-header flow-text"> + {{ weekday }}, {{ current_date }} <i class="material-icons collapsible-icon-right">expand_more</i> + </div> + <div class="collapsible-body"> + <div class="collection"> + {% for period in periods %} + {% has_perm "alsijil.view_lessondocumentation" user period as can_view_lesson_documentation %} + {% if can_view_lesson_documentation %} + <a class="collection-item avatar" + href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}"> + {% include "alsijil/partials/lesson_status_icon.html" with period=period css_class="materialize-circle" color_suffix=" " %} + <table class="hide-on-med-and-down"> + <tr> + <th>{% trans "Subject" %}</th> + <td>{{ period.period.period }}. {{ period.get_subject.name }}</td> + </tr> + {% if not group %} + <tr> + <th>{% trans "Group" %}</th> + <td>{{ period.lesson.group_names }}</td> + </tr> + {% endif %} + <tr> + <th>{% trans "Teachers" %}</th> + <td>{{ period.lesson.teacher_names }}</td> + </tr> + <tr> + <th>{% trans "Lesson topic" %}</th> + <td>{% firstof period.get_lesson_documentation.topic "–" %}</td> + </tr> + {% with period.get_lesson_documentation as lesson_documentation %} + {% if lesson_documentation.homework %} + <tr> + <th>{% trans "Homework" %}</th> + <td>{% firstof period.get_lesson_documentation.homework "–" %}</td> + </tr> + {% endif %} + {% if lesson_documentation.group_note %} + <tr> + <th>{% trans "Group note" %}</th> + <td>{% firstof period.get_lesson_documentation.group_note "–" %}</td> + </tr> + {% endif %} + {% endwith %} + </table> + <div class="hide-on-large-only"> + <ul class="collection"> + <li class="collection-item"> + {{ period.period.period }}. {{ period.get_subject.name }} + </li> + {% if not group %} + <li class="collection-item"> + + {{ period.lesson.group_names }} + + </li> + {% endif %} + <li class="collection-item"> + {{ period.lesson.teacher_names }} + </li> + <li class="collection-item"> + {{ period.get_lesson_documentation.topic }} + </li> + {% with period.get_lesson_documentation as lesson_documentation %} + {% if lesson_documentation.homework %} + <li class="collection-item"> + <strong>{% trans "Homework" %}</strong> + {% firstof period.get_lesson_documentation.homework "–" %} + </li> + {% endif %} + {% if lesson_documentation.group_note %} + <li class="collection-item"> + <strong>{% trans "Group note" %}</strong> + {% firstof period.get_lesson_documentation.group_note "–" %} + </li> + {% endif %} + {% endwith %} + </ul> + </div> + </a> + {% endif %} + {% endfor %} + </div> + </div> + </li> + </ul> + {% endif %} + {% endwith %} {% endfor %} </div> <div class="col s12" id="personal-notes"> @@ -251,7 +276,8 @@ {% endif %} {% has_perm "alsijil.register_absence" user person.person as can_register_absence %} {% if can_register_absence %} - <a class="btn primary-color waves-effect waves-light right" href="{% url "register_absence" person.person.pk %}"> + <a class="btn primary-color waves-effect waves-light right" + href="{% url "register_absence" person.person.pk %}"> <i class="material-icons left">rate_review</i> {% trans "Register absence" %} </a> @@ -262,7 +288,7 @@ ({{ person.person.unexcused_count }} {% trans "unexcused" %}) </p> <p class="card-text"> - {% trans "Summed up tardiness" %}: {% firstof person.person.tardiness_sum|to_time|time:"H\h i\m" "–" %} + {% trans "Summed up tardiness" %}: {% firstof person.person.tardiness_sum|to_time|time:"H\h i\m" "–" %} </p> <p class="card-text"> {% trans "Count of tardiness" %}: {{ person.person.tardiness_count }} × @@ -306,14 +332,14 @@ {% endif %} <script> - $(document).ready(function () { - $("#id_group").change(function () { - $("#id_teacher").val("").formSelect(); - }); - $("#id_teacher").change(function () { - $("#id_group").val("").formSelect(); + $(document).ready(function () { + $("#id_group").change(function () { + $("#id_teacher").val("").formSelect(); + }); + $("#id_teacher").change(function () { + $("#id_group").val("").formSelect(); + }); }); - }); </script> {% endblock %} diff --git a/aleksis/apps/alsijil/views.py b/aleksis/apps/alsijil/views.py index 5c0d38ca8bb239db6acd65e53b1d5b2600b35c8b..6b5c693313b598884fa4a5e46f1256df7d912866 100644 --- a/aleksis/apps/alsijil/views.py +++ b/aleksis/apps/alsijil/views.py @@ -16,7 +16,8 @@ from reversion.views import RevisionMixin from rules.contrib.views import PermissionRequiredMixin, permission_required from aleksis.apps.chronos.managers import TimetableType -from aleksis.apps.chronos.models import LessonPeriod, TimePeriod +from aleksis.apps.chronos.models import Holiday, LessonPeriod, TimePeriod +from aleksis.apps.chronos.util.build import build_weekdays from aleksis.apps.chronos.util.date import get_weeks_for_year, week_weekday_to_date from aleksis.core.mixins import AdvancedCreateView, AdvancedDeleteView, AdvancedEditView from aleksis.core.models import Group, Person, SchoolTerm @@ -90,6 +91,13 @@ def lesson( _("You are not allowed to create a lesson documentation for a lesson in the future.") ) + holiday = Holiday.on_day(date_of_lesson) + blocked_because_holidays = ( + holiday is not None and not get_site_preferences()["alsijil__allow_entries_in_holidays"] + ) + context["blocked_because_holidays"] = blocked_because_holidays + context["holiday"] = holiday + next_lesson = request.user.person.next_lesson(lesson_period, date_of_lesson) prev_lesson = request.user.person.previous_lesson(lesson_period, date_of_lesson) @@ -98,69 +106,71 @@ def lesson( context["day"] = wanted_week[lesson_period.period.weekday] context["next_lesson_person"] = next_lesson context["prev_lesson_person"] = prev_lesson + context["prev_lesson"] = lesson_period.prev + context["next_lesson"] = lesson_period.next - # Create or get lesson documentation object; can be empty when first opening lesson - lesson_documentation = lesson_period.get_or_create_lesson_documentation(wanted_week) - lesson_documentation_form = LessonDocumentationForm( - request.POST or None, instance=lesson_documentation, prefix="lesson_documentation", - ) + if not blocked_because_holidays: - # Create a formset that holds all personal notes for all persons in this lesson - if not request.user.has_perm("alsijil.view_lesson_personalnote", lesson_period): - persons = Person.objects.filter(pk=request.user.person.pk) - else: - persons = Person.objects.all() + # Create or get lesson documentation object; can be empty when first opening lesson + lesson_documentation = lesson_period.get_or_create_lesson_documentation(wanted_week) + lesson_documentation_form = LessonDocumentationForm( + request.POST or None, instance=lesson_documentation, prefix="lesson_documentation", + ) - persons_qs = lesson_period.get_personal_notes(persons, wanted_week) - personal_note_formset = PersonalNoteFormSet( - request.POST or None, queryset=persons_qs, prefix="personal_notes" - ) + # Create a formset that holds all personal notes for all persons in this lesson + if not request.user.has_perm("alsijil.view_lesson_personalnote", lesson_period): + persons = Person.objects.filter(pk=request.user.person.pk) + else: + persons = Person.objects.all() - if request.method == "POST": - if lesson_documentation_form.is_valid() and request.user.has_perm( - "alsijil.edit_lessondocumentation", lesson_period - ): - with reversion.create_revision(): - reversion.set_user(request.user) - lesson_documentation_form.save() - - messages.success(request, _("The lesson documentation has been saved.")) - - substitution = lesson_period.get_substitution() - if ( - not getattr(substitution, "cancelled", False) - or not get_site_preferences()["alsijil__block_personal_notes_for_cancelled"] - ): - if personal_note_formset.is_valid() and request.user.has_perm( - "alsijil.edit_lesson_personalnote", lesson_period + persons_qs = lesson_period.get_personal_notes(persons, wanted_week) + personal_note_formset = PersonalNoteFormSet( + request.POST or None, queryset=persons_qs, prefix="personal_notes" + ) + + if request.method == "POST": + if lesson_documentation_form.is_valid() and request.user.has_perm( + "alsijil.edit_lessondocumentation", lesson_period ): with reversion.create_revision(): reversion.set_user(request.user) - instances = personal_note_formset.save() - - # Iterate over personal notes and carry changed absences to following lessons - for instance in instances: - instance.person.mark_absent( - wanted_week[lesson_period.period.weekday], - lesson_period.period.period + 1, - instance.absent, - instance.excused, - instance.excuse_type, - ) + lesson_documentation_form.save() - messages.success(request, _("The personal notes have been saved.")) + messages.success(request, _("The lesson documentation has been saved.")) - # Regenerate form here to ensure that programmatically - # changed data will be shown correctly - personal_note_formset = PersonalNoteFormSet( - None, queryset=persons_qs, prefix="personal_notes" - ) + substitution = lesson_period.get_substitution() + if ( + not getattr(substitution, "cancelled", False) + or not get_site_preferences()["alsijil__block_personal_notes_for_cancelled"] + ): + if personal_note_formset.is_valid() and request.user.has_perm( + "alsijil.edit_lesson_personalnote", lesson_period + ): + with reversion.create_revision(): + reversion.set_user(request.user) + instances = personal_note_formset.save() + + # Iterate over personal notes and carry changed absences to following lessons + for instance in instances: + instance.person.mark_absent( + wanted_week[lesson_period.period.weekday], + lesson_period.period.period + 1, + instance.absent, + instance.excused, + instance.excuse_type, + ) - context["lesson_documentation"] = lesson_documentation - context["lesson_documentation_form"] = lesson_documentation_form - context["personal_note_formset"] = personal_note_formset - context["prev_lesson"] = lesson_period.prev - context["next_lesson"] = lesson_period.next + messages.success(request, _("The personal notes have been saved.")) + + # Regenerate form here to ensure that programmatically + # changed data will be shown correctly + personal_note_formset = PersonalNoteFormSet( + None, queryset=persons_qs, prefix="personal_notes" + ) + + context["lesson_documentation"] = lesson_documentation + context["lesson_documentation_form"] = lesson_documentation_form + context["personal_note_formset"] = personal_note_formset return render(request, "alsijil/class_register/lesson.html", context) @@ -361,6 +371,7 @@ def week_view( context["group"] = group context["select_form"] = select_form context["instance"] = instance + context["weekdays"] = build_weekdays(TimePeriod.WEEKDAY_CHOICES, wanted_week) week_prev = wanted_week - 1 week_next = wanted_week + 1 @@ -497,7 +508,7 @@ def my_students(request: HttpRequest) -> HttpResponse: def my_groups(request: HttpRequest) -> HttpResponse: context = {} context["groups"] = request.user.person.get_owner_groups_with_lessons().annotate( - students_count=Count("members") + students_count=Count("members", distinct=True) ) return render(request, "alsijil/class_register/groups.html", context) @@ -677,6 +688,8 @@ def register_absence(request: HttpRequest, id_: int) -> HttpResponse: register_absence_form = RegisterAbsenceForm(request.POST or None) if request.method == "POST" and register_absence_form.is_valid(): + confirmed = request.POST.get("confirmed", "0") == "1" + # Get data from form # person = register_absence_form.cleaned_data["person"] start_date = register_absence_form.cleaned_data["date_start"] @@ -689,18 +702,41 @@ def register_absence(request: HttpRequest, id_: int) -> HttpResponse: remarks = register_absence_form.cleaned_data["remarks"] # Mark person as absent + affected_count = 0 delta = end_date - start_date for i in range(delta.days + 1): from_period_on_day = from_period if i == 0 else TimePeriod.period_min to_period_on_day = to_period if i == delta.days else TimePeriod.period_max day = start_date + timedelta(days=i) - person.mark_absent( - day, from_period_on_day, absent, excused, excuse_type, remarks, to_period_on_day, + # Skip holidays if activated + if not get_site_preferences()["alsijil__allow_entries_in_holidays"]: + holiday = Holiday.on_day(day) + if holiday: + continue + + affected_count += person.mark_absent( + day, + from_period_on_day, + absent, + excused, + excuse_type, + remarks, + to_period_on_day, + dry_run=not confirmed, ) - messages.success(request, _("The absence has been saved.")) - return redirect("overview_person", person.pk) + if not confirmed: + # Show confirmation page + context = {} + context["affected_lessons"] = affected_count + context["person"] = person + context["form_data"] = register_absence_form.cleaned_data + context["form"] = register_absence_form + return render(request, "alsijil/absences/register_confirm.html", context) + else: + messages.success(request, _("The absence has been saved.")) + return redirect("overview_person", person.pk) context["person"] = person context["register_absence_form"] = register_absence_form