146 lines
3.1 KiB
HTML
146 lines
3.1 KiB
HTML
{% 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="row mb-3">
|
|
<label for="name" class="form-label col-md-2">
|
|
Nom
|
|
</label>
|
|
<div class="col-md-10">
|
|
<input
|
|
id="name"
|
|
class="form-control"
|
|
type="text"
|
|
name="name"
|
|
required
|
|
value="{{ Section.Name }}"
|
|
autocomplete="off"
|
|
autofocus
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<label for="short_name" class="form-label col-md-2">
|
|
Nom technique
|
|
</label>
|
|
<div class="col-md-10">
|
|
<input
|
|
id="short_name"
|
|
class="form-control"
|
|
type="text"
|
|
name="short_name"
|
|
required
|
|
value="{{ Section.ShortName }}"
|
|
autocomplete="off"
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<label for="parent_section" class="form-label col-md-2">
|
|
Section parente
|
|
</label>
|
|
<div class="col-md-10">
|
|
<select
|
|
id="parent_section"
|
|
class="form-select"
|
|
name="parent_section"
|
|
autocomplete="off"
|
|
{% if IsParent %}
|
|
disabled
|
|
{% endif %}
|
|
>
|
|
<option value="0">
|
|
--- Pas de section parente ---
|
|
</option>
|
|
{% if !IsParent %}
|
|
{% for ParentSection in Sections %}
|
|
<option
|
|
value="{{ ParentSection.ID }}"
|
|
{% if Section.ParentSectionID == ParentSection.ID %}selected{% endif %}
|
|
>
|
|
{{ ParentSection.Name }}
|
|
</option>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<div class="col-md-10 offset-md-2">
|
|
<input
|
|
type="checkbox"
|
|
class="form-check-input me-2"
|
|
id="contains_members"
|
|
name="contains_members"
|
|
autocomplete="off"
|
|
{% if Section.ContainsMembers %}
|
|
checked
|
|
{% endif %}
|
|
>
|
|
<label for="contains_members" class="form-label">
|
|
Contient des membres
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<div class="col-md-10 offset-md-2">
|
|
<input
|
|
type="checkbox"
|
|
class="form-check-input me-2"
|
|
id="contains_contacts"
|
|
name="contains_contacts"
|
|
autocomplete="off"
|
|
{% if Section.ContainsContacts %}
|
|
checked
|
|
{% endif %}
|
|
>
|
|
<label for="contains_contacts" class="form-label">
|
|
Contient des contacts
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="my-4">
|
|
<button class="btn btn-outline-primary" type="submit">
|
|
<i class="me-1 bi-floppy"></i>
|
|
Enregistrer
|
|
</button>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
{% endblock %}
|