diff --git a/Palto/Palto/models.py b/Palto/Palto/models.py index d695988..782ae06 100644 --- a/Palto/Palto/models.py +++ b/Palto/Palto/models.py @@ -543,7 +543,7 @@ class TeachingSession(models.Model, ModelPermissionHelper): """ return Absence.objects.filter( - student__in=self.group.students, + student__in=self.group.students.all(), start__lte=self.start, end__gte=self.end ).distinct() diff --git a/Palto/Palto/static/Palto/css/base.css b/Palto/Palto/static/Palto/css/base.css index 9830d27..0d09586 100644 --- a/Palto/Palto/static/Palto/css/base.css +++ b/Palto/Palto/static/Palto/css/base.css @@ -1,15 +1,47 @@ -/* tweaks */ -body { - margin: 0; -} - /* font */ * { font-family: "Century Gothic", sans-serif; } +/* color-scheme */ +@media (prefers-color-scheme: light) { + :root { + --primary: #00345F; + --secondary: #EF800A; + + --foreground: #1B1B1B; + --background: #FFFFFF; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --primary: #00549F; + --secondary: #EF800A; + + --foreground: #FFFFFF; + --background: #1B1B1B; + } +} + /* links */ *:link, *:visited { - color: blue; /* TODO: should be palette based color */ + color: var(--primary); text-decoration: none; } + +*:link:hover, *:visited:hover { + color: var(--secondary); +} + +/* table */ +table, tr, th, td { + border-color: var(--foreground) !important; +} + +/* tweaks */ +body { + margin: 0; + color: var(--foreground); + background-color: var(--background); +} \ No newline at end of file diff --git a/Palto/Palto/static/Palto/css/department_view.css b/Palto/Palto/static/Palto/css/table_view.css similarity index 64% rename from Palto/Palto/static/Palto/css/department_view.css rename to Palto/Palto/static/Palto/css/table_view.css index cfb6dcb..085f09f 100644 --- a/Palto/Palto/static/Palto/css/department_view.css +++ b/Palto/Palto/static/Palto/css/table_view.css @@ -1,39 +1,34 @@ -#department-informations { +#table-informations { border-collapse: collapse; border: 2px solid black; margin: 5% auto; } -#department-informations th { +#table-informations th { text-align: right; border: 1px solid black; padding: 4px; } -#department-informations td { +#table-informations td { text-align: left; border: 1px solid black; padding: 4px; } -#department-relations { +#table-relations { display: flex; width: 60%; margin: auto; } -.department-relation { +.table-relation { border-collapse: collapse; border: 2px solid black; margin: 0 auto auto auto; } -.department-relation th { +.table-relation th, .table-relation td { border: 2px solid black; padding: 4px; } - -.department-relation td { - border: 2px solid black; - padding: 4px; -} \ No newline at end of file diff --git a/Palto/Palto/templates/Palto/department_view.html b/Palto/Palto/templates/Palto/department_view.html index 43a2563..3e69b13 100644 --- a/Palto/Palto/templates/Palto/department_view.html +++ b/Palto/Palto/templates/Palto/department_view.html @@ -12,14 +12,14 @@ {% block style %} {{ block.super }} - + {% endblock %} {% block body %} {{ block.super }} {# department's information #} - +
@@ -42,9 +42,9 @@
Identifiant {{ department.id }}
-
+
{# department's managers #} - +
@@ -60,7 +60,7 @@
Responsables
{# department's teachers #} - +
diff --git a/Palto/Palto/templates/Palto/student_group.html b/Palto/Palto/templates/Palto/student_group.html index a5c0b1a..8d538fa 100644 --- a/Palto/Palto/templates/Palto/student_group.html +++ b/Palto/Palto/templates/Palto/student_group.html @@ -1,4 +1,5 @@ {% extends "Palto/base/base-features.html" %} +{% load static %} {% block page-title %} Groupe Étudiant {{ group.name }} @@ -8,11 +9,16 @@ Groupe Étudiant {{ group.name }} {% endblock %} +{% block style %} + {{ block.super }} + +{% endblock %} + {% block body %} {{ block.super }} {# group's information #} -
Enseignants
+
@@ -31,19 +37,21 @@
Identifiant {{ group.id }}
- {# group's students information #} - - - - - - - - {% for student in group.students.all %} +
+ {# group's students information #} +
Étudiants
+ - + - {% endfor %} - -
{{ student }}Étudiants
+ + + {% for student in group.students.all %} + + {{ student }} + + {% endfor %} + + +
{% endblock %} diff --git a/Palto/Palto/templates/Palto/teaching_session_view.html b/Palto/Palto/templates/Palto/teaching_session_view.html index 290ecbd..3a0dbc3 100644 --- a/Palto/Palto/templates/Palto/teaching_session_view.html +++ b/Palto/Palto/templates/Palto/teaching_session_view.html @@ -1,5 +1,6 @@ {% extends "Palto/base/base-features.html" %} {% load dict_tags %} +{% load static %} {% block page-title %} Session de {{ session.unit.name }} @@ -9,11 +10,16 @@ Session de {{ session.unit.name }} {% endblock %} +{% block style %} + {{ block.super }} + +{% endblock %} + {% block body %} {{ block.super }} {# session's information #} - +
@@ -39,38 +45,40 @@
Identifiant {{ session.id }}{{ session.group }}
- - {# session's students information #} - - - - - - - - - - {% for student, session_student_data in session_students_data.items %} + +
+ {# session's students information #} +
ElèvePrésenceAbsence
+ - - - + + + - {% endfor %} - -
{{ student }} - {% with attendance=session_student_data|dict_get:"attendance" %} - {% if attendance != None %} - {{ attendance.date }} - {% endif %} - {% endwith %} - - {% with absence=session_student_data|dict_get:"absence" %} - {% if absence != None %} - Détails - {% endif %} - {% endwith %} - ElèvePrésenceAbsence
- + + + {% for student, session_student_data in session_students_data.items %} + + {{ student }} + + {% with attendance=session_student_data|dict_get:"attendance" %} + {% if attendance != None %} + {{ attendance.date }} + {% endif %} + {% endwith %} + + + {% with absence=session_student_data|dict_get:"absence" %} + {% if absence != None %} + Détails + {% endif %} + {% endwith %} + + + {% endfor %} + + +
+ {# TODO(Raphaël): export boutton #} {% endblock %} diff --git a/Palto/Palto/templates/Palto/teaching_unit_view.html b/Palto/Palto/templates/Palto/teaching_unit_view.html index 491b624..00a9df9 100644 --- a/Palto/Palto/templates/Palto/teaching_unit_view.html +++ b/Palto/Palto/templates/Palto/teaching_unit_view.html @@ -1,5 +1,6 @@ {% extends "Palto/base/base-features.html" %} {% load dict_tags %} +{% load static %} {% block page-title %} Unité d'Enseignement de {{ unit.name }} @@ -9,11 +10,16 @@ Unité d'Enseignement de {{ unit.name }} {% endblock %} +{% block style %} + {{ block.super }} + +{% endblock %} + {% block body %} {{ block.super }} {# unit's information #} - +
@@ -24,7 +30,7 @@ - + @@ -36,35 +42,37 @@
Identifiant {{ unit.id }}
Département{{ unit.department.name }}{{ unit.department.name }}
Mail
- {# unit's managers #} - - - - - - - - {% for manager in unit.managers.all %} +
+ {# unit's managers #} +
Responsables
+ - + - {% endfor %} - -
{{ manager }}Responsables
- - {# unit's teachers #} - - - - - - - - {% for teacher in unit.teachers.all %} + + + {% for manager in unit.managers.all %} + + + + {% endfor %} + +
Enseignants
{{ manager }}
+ + {# unit's teachers #} + + - + - {% endfor %} - -
{{ teacher }}Enseignants
+ + + {% for teacher in unit.teachers.all %} + + {{ teacher }} + + {% endfor %} + + + {% endblock %}