Manage optionnal fields

This commit is contained in:
William Bouzourène 2025-01-06 17:05:03 +01:00
parent 3e4cc96027
commit 360ed9acd4
7 changed files with 518 additions and 0 deletions

67
views/fields.html Normal file
View file

@ -0,0 +1,67 @@
{% extends "layouts/main.html" %}
{% block main %}
<div class="container mt-4">
<div class="mb-4">
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item"><a href="/admin">Administration</a></li>
<li class="breadcrumb-item active">Champs supplémentaires</li>
</ol>
</nav>
<hr>
</div>
{% if Fields %}
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Nom</th>
<th>Population</th>
<th>Type de champ</th>
</tr>
</thead>
<tbody>
{% for Field in Fields %}
<tr>
<td>
<a href="/admin/fields/{{ Field.ID }}">
{{ Field.Name }}
</a>
</td>
<td>
{% for Key, Value in PersonTypes %}
{% if Key == Field.PersonType %}
{{ Value }}
{% endif %}
{% endfor %}
</td>
<td>
{% for Key, Value in FieldTypes %}
{% if Key == Field.FieldType %}
{{ Value }}
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="my-4">
Pas de champs pour le moment
</div>
{% endif %}
<div class="mt-3">
<a class="btn btn-md btn-primary" href="/admin/fields/add">
<i class="bi-plus-lg"></i>
Ajouter
</a>
</div>
</div>
{% endblock %}