Gestion des sections
This commit is contained in:
parent
455930b4c2
commit
f7c8fa4539
5 changed files with 498 additions and 0 deletions
64
views/section.html
Normal file
64
views/section.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{% 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/sections">Sections</a></li>
|
||||
<li class="breadcrumb-item active">{{ Section.Name }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Nom</b><br>
|
||||
{{ Section.Name }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Nom technique</b><br>
|
||||
{{ Section.ShortName }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Section parente</b><br>
|
||||
{% if Section.ParentSectionID %}
|
||||
{{ Section.ParentSection.Name }}
|
||||
{% else %}
|
||||
N/A
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Contient des membres</b><br>
|
||||
{% if Section.ContainsMembers %}Oui{% else %}Non{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<b>Contient des contacts</b><br>
|
||||
{% if Section.ContainsContacts %}Oui{% else %}Non{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-md btn-primary" href="/admin/sections/{{ Section.ID }}/edit">
|
||||
<i class="feather" data-feather="edit-2"></i>
|
||||
Modifier
|
||||
</a>
|
||||
<form
|
||||
action="/admin/sections/{{ Section.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>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
119
views/section_form.html
Normal file
119
views/section_form.html
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
{% 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/sections">Sections</a></li>
|
||||
|
||||
{% if Section.ID %}
|
||||
<li class="breadcrumb-item"><a href="/admin/sections/{{ Section.ID }}">{{ Section.Name }}</a></li>
|
||||
<li class="breadcrumb-item active">Modifier</li>
|
||||
{% else %}
|
||||
<li class="breadcrumb-item active">Ajouter</li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</nav>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
{% if Errors %}
|
||||
<div class="alert alert-danger">
|
||||
<ul class="m-0">
|
||||
{% for Error in Errors %}
|
||||
<li>{{ Error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form id="section" method="post">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">
|
||||
Nom
|
||||
</label>
|
||||
<input
|
||||
id="name"
|
||||
class="form-control"
|
||||
type="text"
|
||||
name="name"
|
||||
required
|
||||
value="{{ Section.Name }}"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="short_name" class="form-label">
|
||||
Nom technique
|
||||
</label>
|
||||
<input
|
||||
id="short_name"
|
||||
class="form-control"
|
||||
type="text"
|
||||
name="short_name"
|
||||
required
|
||||
value="{{ Section.ShortName }}"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="parent_section" class="form-label">
|
||||
Section parente
|
||||
</label>
|
||||
<select
|
||||
id="parent_section"
|
||||
class="form-control"
|
||||
name="parent_section"
|
||||
>
|
||||
<option value="0">--- Pas de section parente ---</option>
|
||||
{% for ParentSection in Sections %}
|
||||
<option
|
||||
value="{{ ParentSection.ID }}"
|
||||
{% if Section.ParentSectionID == ParentSection.ID %}selected{% endif %}
|
||||
>
|
||||
{{ ParentSection.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-check-input me-2"
|
||||
id="contains_members"
|
||||
name="contains_members"
|
||||
{% if Section.ContainsMembers %}checked{% endif %}
|
||||
>
|
||||
<label for="contains_members" class="form-label">
|
||||
Contient des membres
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-check-input me-2"
|
||||
id="contains_contacts"
|
||||
name="contains_contacts"
|
||||
{% if Section.ContainsContacts %}checked{% endif %}
|
||||
>
|
||||
<label for="contains_contacts" class="form-label">
|
||||
Contient des contacts
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="me-1" data-feather="save"></i>
|
||||
Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
79
views/sections.html
Normal file
79
views/sections.html
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{% 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">Sections</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
{% if Sections %}
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Nom technique</th>
|
||||
<th>Section parente</th>
|
||||
<th>Contient membres</th>
|
||||
<th>Contient contacts</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Section in Sections %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/admin/sections/{{ Section.ID }}">
|
||||
{{ Section.Name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Section.ShortName }}
|
||||
</td>
|
||||
<td>
|
||||
{% if Section.ParentSectionID %}
|
||||
{{ Section.ParentSection.Name }}
|
||||
{% else %}
|
||||
N/A
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if Section.ContainsMembers %}
|
||||
Oui
|
||||
{% else %}
|
||||
Non
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if Section.ContainsContacts %}
|
||||
Oui
|
||||
{% else %}
|
||||
Non
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="my-4">
|
||||
Pas de section pour le moment
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-md btn-primary" href="/admin/sections/add">
|
||||
<i class="feather" data-feather="plus"></i>
|
||||
Ajouter
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue