improved css

This commit is contained in:
Faraphel 2024-01-16 00:03:00 +01:00
parent 7f1564dd0d
commit 9c4cb77d35
7 changed files with 149 additions and 98 deletions

View file

@ -543,7 +543,7 @@ class TeachingSession(models.Model, ModelPermissionHelper):
""" """
return Absence.objects.filter( return Absence.objects.filter(
student__in=self.group.students, student__in=self.group.students.all(),
start__lte=self.start, end__gte=self.end start__lte=self.start, end__gte=self.end
).distinct() ).distinct()

View file

@ -1,15 +1,47 @@
/* tweaks */
body {
margin: 0;
}
/* font */ /* font */
* { * {
font-family: "Century Gothic", sans-serif; 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 */ /* links */
*:link, *:visited { *:link, *:visited {
color: blue; /* TODO: should be palette based color */ color: var(--primary);
text-decoration: none; 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);
}

View file

@ -1,39 +1,34 @@
#department-informations { #table-informations {
border-collapse: collapse; border-collapse: collapse;
border: 2px solid black; border: 2px solid black;
margin: 5% auto; margin: 5% auto;
} }
#department-informations th { #table-informations th {
text-align: right; text-align: right;
border: 1px solid black; border: 1px solid black;
padding: 4px; padding: 4px;
} }
#department-informations td { #table-informations td {
text-align: left; text-align: left;
border: 1px solid black; border: 1px solid black;
padding: 4px; padding: 4px;
} }
#department-relations { #table-relations {
display: flex; display: flex;
width: 60%; width: 60%;
margin: auto; margin: auto;
} }
.department-relation { .table-relation {
border-collapse: collapse; border-collapse: collapse;
border: 2px solid black; border: 2px solid black;
margin: 0 auto auto auto; 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; border: 2px solid black;
padding: 4px; padding: 4px;
} }

View file

@ -12,14 +12,14 @@
{% block style %} {% block style %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/department_view.css" %}" /> <link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{# department's information #} {# department's information #}
<table id="department-informations"> <table id="table-informations">
<tr> <tr>
<th>Identifiant</th> <th>Identifiant</th>
<td>{{ department.id }}</td> <td>{{ department.id }}</td>
@ -42,9 +42,9 @@
</tr> </tr>
</table> </table>
<div id="department-relations"> <div id="table-relations">
{# department's managers #} {# department's managers #}
<table class="department-relation"> <table class="table-relation">
<thead> <thead>
<tr> <tr>
<th>Responsables</th> <th>Responsables</th>
@ -60,7 +60,7 @@
</table> </table>
{# department's teachers #} {# department's teachers #}
<table class="department-relation"> <table class="table-relation">
<thead> <thead>
<tr> <tr>
<th>Enseignants</th> <th>Enseignants</th>

View file

@ -1,4 +1,5 @@
{% extends "Palto/base/base-features.html" %} {% extends "Palto/base/base-features.html" %}
{% load static %}
{% block page-title %} {% block page-title %}
Groupe Étudiant {{ group.name }} Groupe Étudiant {{ group.name }}
@ -8,11 +9,16 @@
Groupe Étudiant {{ group.name }} Groupe Étudiant {{ group.name }}
{% endblock %} {% endblock %}
{% block style %}
{{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{# group's information #} {# group's information #}
<table> <table id="table-informations">
<tr> <tr>
<th>Identifiant</th> <th>Identifiant</th>
<td>{{ group.id }}</td> <td>{{ group.id }}</td>
@ -31,19 +37,21 @@
</tr> </tr>
</table> </table>
{# group's students information #} <div id="table-relations">
<table> {# group's students information #}
<thead> <table class="table-relation">
<tr> <thead>
<th>Étudiants</th>
</tr>
</thead>
<tbody>
{% for student in group.students.all %}
<tr> <tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td> <th>Étudiants</th>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for student in group.students.all %}
<tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %} {% endblock %}

View file

@ -1,5 +1,6 @@
{% extends "Palto/base/base-features.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% load static %}
{% block page-title %} {% block page-title %}
Session de {{ session.unit.name }} Session de {{ session.unit.name }}
@ -9,11 +10,16 @@
Session de {{ session.unit.name }} Session de {{ session.unit.name }}
{% endblock %} {% endblock %}
{% block style %}
{{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{# session's information #} {# session's information #}
<table> <table id="table-informations">
<tr> <tr>
<th>Identifiant</th> <th>Identifiant</th>
<td>{{ session.id }}</td> <td>{{ session.id }}</td>
@ -40,37 +46,39 @@
</tr> </tr>
</table> </table>
{# session's students information #} <div id="table-relations">
<table> {# session's students information #}
<thead> <table class="table-relation">
<tr> <thead>
<th>Elève</th>
<th>Présence</th>
<th>Absence</th>
</tr>
</thead>
<tbody>
{% for student, session_student_data in session_students_data.items %}
<tr> <tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td> <th>Elève</th>
<td> <th>Présence</th>
{% with attendance=session_student_data|dict_get:"attendance" %} <th>Absence</th>
{% if attendance != None %}
{{ attendance.date }}
{% endif %}
{% endwith %}
</td>
<td>
{% with absence=session_student_data|dict_get:"absence" %}
{% if absence != None %}
<a href="{% url "Palto:absence_view" absence.id %}">Détails</a>
{% endif %}
{% endwith %}
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for student, session_student_data in session_students_data.items %}
<tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td>
<td>
{% with attendance=session_student_data|dict_get:"attendance" %}
{% if attendance != None %}
{{ attendance.date }}
{% endif %}
{% endwith %}
</td>
<td>
{% with absence=session_student_data|dict_get:"absence" %}
{% if absence != None %}
<a href="{% url "Palto:absence_view" absence.id %}">Détails</a>
{% endif %}
{% endwith %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{# TODO(Raphaël): export boutton #} {# TODO(Raphaël): export boutton #}
{% endblock %} {% endblock %}

View file

@ -1,5 +1,6 @@
{% extends "Palto/base/base-features.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% load static %}
{% block page-title %} {% block page-title %}
Unité d'Enseignement de {{ unit.name }} Unité d'Enseignement de {{ unit.name }}
@ -9,11 +10,16 @@
Unité d'Enseignement de {{ unit.name }} Unité d'Enseignement de {{ unit.name }}
{% endblock %} {% endblock %}
{% block style %}
{{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{# unit's information #} {# unit's information #}
<table> <table id="table-informations">
<tr> <tr>
<th>Identifiant</th> <th>Identifiant</th>
<td>{{ unit.id }}</td> <td>{{ unit.id }}</td>
@ -24,7 +30,7 @@
</tr> </tr>
<tr> <tr>
<th>Département</th> <th>Département</th>
<td href="{% url "Palto:department_view" unit.department.id %}">{{ unit.department.name }}</td> <td><a href="{% url "Palto:department_view" unit.department.id %}">{{ unit.department.name }}</a></td>
</tr> </tr>
<tr> <tr>
<th>Mail</th> <th>Mail</th>
@ -36,35 +42,37 @@
</tr> </tr>
</table> </table>
{# unit's managers #} <div id="table-relations">
<table> {# unit's managers #}
<thead> <table class="table-relation">
<tr> <thead>
<th>Responsables</th>
</tr>
</thead>
<tbody>
{% for manager in unit.managers.all %}
<tr> <tr>
<td><a href="{% url "Palto:profile" manager.id %}">{{ manager }}</a></td> <th>Responsables</th>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for manager in unit.managers.all %}
<tr>
<td><a href="{% url "Palto:profile" manager.id %}">{{ manager }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{# unit's teachers #} {# unit's teachers #}
<table> <table class="table-relation">
<thead> <thead>
<tr>
<th>Enseignants</th>
</tr>
</thead>
<tbody>
{% for teacher in unit.teachers.all %}
<tr> <tr>
<td><a href="{% url "Palto:profile" teacher.id %}">{{ teacher }}</a></td> <th>Enseignants</th>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for teacher in unit.teachers.all %}
<tr>
<td><a href="{% url "Palto:profile" teacher.id %}">{{ teacher }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %} {% endblock %}