Admin: Gestion des listes
This commit is contained in:
parent
6acd737b99
commit
28662ed965
13 changed files with 605 additions and 29 deletions
98
views/list.html
Normal file
98
views/list.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{% 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"><a href="/admin/lists">Listes</a></li>
|
||||
<li class="breadcrumb-item active">{{ List.Name }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Nom</b><br>
|
||||
{{ List.Name }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Liste à choix multiples</b><br>
|
||||
{% if List.Multi %}Oui{% else %}Non{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-md btn-primary" href="/admin/lists/{{ List.ID }}/edit">
|
||||
<i class="feather" data-feather="edit-2"></i>
|
||||
Modifier
|
||||
</a>
|
||||
<form
|
||||
action="/admin/lists/{{ List.ID }}/delete"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-danger areyousure" type="submit">
|
||||
<i class="feather" data-feather="trash-2"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% if ListItems %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Valeur</th>
|
||||
<th>Par défaut</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Item in ListItems %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/admin/lists/{{ List.ID }}/items/{{ Item.ID }}">
|
||||
{{ Item.Value }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if Item.Default %}
|
||||
Oui
|
||||
{% else %}
|
||||
Non
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<form
|
||||
action="/admin/lists/{{ List.ID }}/items/{{ Item.ID }}/delete"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-danger areyousure" type="submit">
|
||||
<i class="feather" data-feather="trash-2"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div>
|
||||
Pas encore d'éléments dans cette liste.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-md btn-primary" href="/admin/lists/{{ List.ID }}/items/add">
|
||||
<i class="feather" data-feather="plus"></i>
|
||||
Ajouter
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue