added basic css for department view

This commit is contained in:
Faraphel 2024-01-05 11:43:19 +01:00
parent 06cf3b1160
commit f829efcb9e
2 changed files with 82 additions and 28 deletions

View file

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

View file

@ -1,12 +1,17 @@
{% extends "Palto/base/base-features.html" %} {% extends "Palto/base/base-features.html" %}
{% load dict_tags %} {% load dict_tags %}
{% load static %}
{% block style %}
{{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/department_view.css" %}" />
{% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{# department's information #} {# department's information #}
<table> <table id="department-informations">
<tr> <tr>
<th>Identifiant</th> <th>Identifiant</th>
<td>{{ department.id }}</td> <td>{{ department.id }}</td>
@ -17,39 +22,49 @@
</tr> </tr>
<tr> <tr>
<th>Mail</th> <th>Mail</th>
<td>{% if department.email != None %}{{ department.email }}{% else %} / {% endif %}</td> <td><a href="mailto:{{ department.email }}">{{ department.email }}</a></td>
</tr>
<tr>
<th>Enseignants</th>
<td>{{ department.teachers.count }}</td>
</tr>
<tr>
<th>Étudiants</th>
<td>{{ department.students.count }}</td>
</tr> </tr>
</table> </table>
{# department's managers #} <div id="department-relations">
<table> {# department's managers #}
<thead> <table class="department-relation">
<tr> <thead>
<th>Responsables</th>
</tr>
</thead>
<tbody>
{% for manager in department.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 department.managers.all %}
<tr>
<td><a href="{% url "Palto:profile" manager.id %}">{{ manager }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{# department's teachers #} {# department's teachers #}
<table> <table class="department-relation">
<thead> <thead>
<tr>
<th>Enseignants</th>
</tr>
</thead>
<tbody>
{% for teacher in department.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 department.teachers.all %}
<tr>
<td><a href="{% url "Palto:profile" teacher.id %}">{{ teacher }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %} {% endblock %}