Permissions: If no sections, do not show list
This commit is contained in:
parent
17a44fa8b6
commit
9a803aabf5
1 changed files with 44 additions and 38 deletions
|
|
@ -25,51 +25,57 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form id="user" method="post">
|
||||
{% if Sections %}
|
||||
<form id="user" method="post">
|
||||
|
||||
{% for Section in Sections %}
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-2">
|
||||
{{ Section.Name }}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<i class="bi-key"></i>
|
||||
</span>
|
||||
<select
|
||||
class="form-select"
|
||||
name="section-{{ Section.ID }}"
|
||||
id="section-{{ Section.ID }}"
|
||||
autocomplete="off"
|
||||
>
|
||||
<option value="0">--- Aucun ---</option>
|
||||
{% for Role in Roles %}
|
||||
<option
|
||||
value="{{ Role.ID }}"
|
||||
{% for Section in Sections %}
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-2">
|
||||
{{ Section.Name }}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<i class="bi-key"></i>
|
||||
</span>
|
||||
<select
|
||||
class="form-select"
|
||||
name="section-{{ Section.ID }}"
|
||||
id="section-{{ Section.ID }}"
|
||||
autocomplete="off"
|
||||
>
|
||||
<option value="0">--- Aucun ---</option>
|
||||
{% for Role in Roles %}
|
||||
<option
|
||||
value="{{ Role.ID }}"
|
||||
|
||||
{% for UserRole in UserRoles %}
|
||||
{% if Section.ID == UserRole.SectionID and Role.ID == UserRole.RoleID %}
|
||||
selected
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
>
|
||||
{{ Role.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% for UserRole in UserRoles %}
|
||||
{% if Section.ID == UserRole.SectionID and Role.ID == UserRole.RoleID %}
|
||||
selected
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
>
|
||||
{{ Role.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="my-4">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="me-1 bi-floppy"></i>
|
||||
Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="my-4">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="me-1 bi-floppy"></i>
|
||||
Enregistrer
|
||||
</button>
|
||||
Pas de section pour le moment
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue