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(
student__in=self.group.students,
student__in=self.group.students.all(),
start__lte=self.start, end__gte=self.end
).distinct()

View file

@ -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);
}

View file

@ -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;
}

View file

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

View file

@ -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 }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %}
{{ block.super }}
{# group's information #}
<table>
<table id="table-informations">
<tr>
<th>Identifiant</th>
<td>{{ group.id }}</td>
@ -31,19 +37,21 @@
</tr>
</table>
{# group's students information #}
<table>
<thead>
<tr>
<th>Étudiants</th>
</tr>
</thead>
<tbody>
{% for student in group.students.all %}
<div id="table-relations">
{# group's students information #}
<table class="table-relation">
<thead>
<tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td>
<th>Étudiants</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for student in group.students.all %}
<tr>
<td><a href="{% url "Palto:profile" student.id %}">{{ student }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

View file

@ -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 }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %}
{{ block.super }}
{# session's information #}
<table>
<table id="table-informations">
<tr>
<th>Identifiant</th>
<td>{{ session.id }}</td>
@ -39,38 +45,40 @@
<td><a href="{% url "Palto:student_group_view" session.group.id %}">{{ session.group }}</a></td>
</tr>
</table>
{# session's students information #}
<table>
<thead>
<tr>
<th>Elève</th>
<th>Présence</th>
<th>Absence</th>
</tr>
</thead>
<tbody>
{% for student, session_student_data in session_students_data.items %}
<div id="table-relations">
{# session's students information #}
<table class="table-relation">
<thead>
<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>
<th>Elève</th>
<th>Présence</th>
<th>Absence</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% 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 #}
{% endblock %}

View file

@ -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 }}
<link rel="stylesheet" href="{% static "Palto/css/table_view.css" %}" />
{% endblock %}
{% block body %}
{{ block.super }}
{# unit's information #}
<table>
<table id="table-informations">
<tr>
<th>Identifiant</th>
<td>{{ unit.id }}</td>
@ -24,7 +30,7 @@
</tr>
<tr>
<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>
<th>Mail</th>
@ -36,35 +42,37 @@
</tr>
</table>
{# unit's managers #}
<table>
<thead>
<tr>
<th>Responsables</th>
</tr>
</thead>
<tbody>
{% for manager in unit.managers.all %}
<div id="table-relations">
{# unit's managers #}
<table class="table-relation">
<thead>
<tr>
<td><a href="{% url "Palto:profile" manager.id %}">{{ manager }}</a></td>
<th>Responsables</th>
</tr>
{% endfor %}
</tbody>
</table>
{# unit's teachers #}
<table>
<thead>
<tr>
<th>Enseignants</th>
</tr>
</thead>
<tbody>
{% for teacher in unit.teachers.all %}
</thead>
<tbody>
{% 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 #}
<table class="table-relation">
<thead>
<tr>
<td><a href="{% url "Palto:profile" teacher.id %}">{{ teacher }}</a></td>
<th>Enseignants</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for teacher in unit.teachers.all %}
<tr>
<td><a href="{% url "Palto:profile" teacher.id %}">{{ teacher }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}