added basic css for profile

This commit is contained in:
Faraphel 2024-01-05 11:26:03 +01:00
parent 35e44bcd7c
commit 06cf3b1160
2 changed files with 114 additions and 66 deletions

View file

@ -0,0 +1,32 @@
#user-informations {
text-align: center;
margin: 5% auto;
}
#user-name {
font-size: 200%;
font-weight: bold;
text-decoration: underline;
}
#user-relations {
border-collapse: collapse;
margin: auto;
text-align: center;
}
#user-relations > tbody > tr > td, #user-relations > tbody > tr > th {
border: 1px solid black;
padding: 4px;
}
.user-relation {
border-style: hidden;
border-collapse: collapse;
width: 100%;
}
.user-relation > tbody > tr > td, .user-relation > tbody > tr > th {
border: 1px solid black;
padding: 4px;
}

View file

@ -1,78 +1,94 @@
{% extends "Palto/base/base-features.html" %} {% extends "Palto/base/base-features.html" %}
{% load static %}
{% load dict_tags %} {% load dict_tags %}
{% block style %}
{{ block.super }}
<link rel="stylesheet" href="{% static "Palto/css/profile.css" %}" />
{% endblock %}
{% block body %} {% block body %}
{{ block.super }} {{ block.super }}
{{ profile.username }} {# user informations #}
{{ profile.email }} <table id="user-informations">
{% if profile.is_superuser %}Administrator{% endif %} <tbody>
<tr><td id="user-name">{{ profile.first_name|title }} {{ profile.last_name|upper }}</td></tr>
<tr><td id="user-username">{{ profile.username }}</td></tr>
<tr><td id="user-mail"><a href="mailto:{{ profile.email }}">{{ profile.email }}</a></td></tr>
<tr><td id="user-role">{% if profile.is_superuser %}Administrator{% endif %}</td></tr>
</tbody>
</table>
{# user related departments table #} {# user related departments table #}
<table> <table id="user-relations">
{% for department, profile_department_data in profile_departments_data.items %} <tbody>
<tr> {% for department, profile_department_data in profile_departments_data.items %}
{# department name #} <tr>
<th><a href="{% url "Palto:department_view" department.id %}">{{ department.name }}</a></th> {# department name #}
{# relation information #} <th><a href="{% url "Palto:department_view" department.id %}">{{ department.name }}</a></th>
<td> {# relation information #}
<table> <td>
{# user managing the department #} <table class="user-relation">
{% if profile_department_data|dict_get:"is_manager" %} <tbody>
<tr> {# user managing the department #}
<td>Responsable de Département</td> {% if profile_department_data|dict_get:"is_manager" %}
<td>/</td>
</tr>
{% endif %}
{# user managing units #}
{% with managing_units=profile_department_data|dict_get:"managing_units" %}
{% if managing_units|length > 0 %}
<tr> <tr>
<td>Responsable d'UE</td> <td>Responsable de Département</td>
<td> <td>/</td>
{% for managing_unit in managing_units %}
<a href="{% url "Palto:teaching_unit_view" managing_unit.id %}">
{{ managing_unit.name }}
</a>
{% if not forloop.last %}<br/>{% endif %}
{% endfor %}
</td>
</tr> </tr>
{% endif %} {% endif %}
{% endwith %} {# user managing units #}
{# user teaching units #} {% with managing_units=profile_department_data|dict_get:"managing_units" %}
{% with teaching_units=profile_department_data|dict_get:"teaching_units" %} {% if managing_units|length > 0 %}
{% if teaching_units|length > 0 %} <tr>
<tr> <td>Responsable d'UE</td>
<td>Enseignant</td> <td>
<td> {% for managing_unit in managing_units %}
{% for teaching_unit in teaching_units %} <a href="{% url "Palto:teaching_unit_view" managing_unit.id %}">
<a href="{% url "Palto:teaching_unit_view" teaching_unit.id %}"> {{ managing_unit.name }}
{{ teaching_unit.name }} </a>
</a> {% if not forloop.last %}<br/>{% endif %}
{% if not forloop.last %}<br/>{% endif %} {% endfor %}
{% endfor %} </td>
</td> </tr>
</tr> {% endif %}
{% endif %} {% endwith %}
{% endwith %} {# user teaching units #}
{# user studying groups #} {% with teaching_units=profile_department_data|dict_get:"teaching_units" %}
{% with student_groups=profile_department_data|dict_get:"student_groups" %} {% if teaching_units|length > 0 %}
{% if student_groups|length > 0 %} <tr>
<tr> <td>Enseignant</td>
<td>Groupe Étudiant</td> <td>
<td> {% for teaching_unit in teaching_units %}
{% for student_group in student_groups %} <a href="{% url "Palto:teaching_unit_view" teaching_unit.id %}">
<a href="{% url "Palto:student_group_view" student_group.id %}">{{ student_group.name }}</a> {{ teaching_unit.name }}
{% if not forloop.last %}<br/>{% endif %} </a>
{% endfor %} {% if not forloop.last %}<br/>{% endif %}
</td> {% endfor %}
</tr> </td>
{% endif %} </tr>
{% endwith %} {% endif %}
</table> {% endwith %}
</td> {# user studying groups #}
</tr> {% with student_groups=profile_department_data|dict_get:"student_groups" %}
{% endfor %} {% if student_groups|length > 0 %}
<tr>
<td>Groupe Étudiant</td>
<td>
{% for student_group in student_groups %}
<a href="{% url "Palto:student_group_view" student_group.id %}">{{ student_group.name }}</a>
{% if not forloop.last %}<br/>{% endif %}
{% endfor %}
</td>
</tr>
{% endif %}
{% endwith %}
</tbody>
</table>
</td>
</tr>
{% endfor %}
</tbody>
</table> </table>
{% endblock %} {% endblock %}