Rework forms
This commit is contained in:
parent
bcb75be549
commit
40999506c8
14 changed files with 1539 additions and 679 deletions
|
|
@ -34,73 +34,81 @@
|
|||
|
||||
<form id="field" method="post">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="form-label col-md-2">
|
||||
Nom du champ
|
||||
</label>
|
||||
<input
|
||||
id="name"
|
||||
class="form-control"
|
||||
type="text"
|
||||
name="name"
|
||||
required
|
||||
value="{{ Field.Name }}"
|
||||
>
|
||||
<div class="col-md-10">
|
||||
<input
|
||||
id="name"
|
||||
class="form-control"
|
||||
type="text"
|
||||
name="name"
|
||||
required
|
||||
value="{{ Field.Name }}"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if !Field.ID %}
|
||||
<div class="mb-3">
|
||||
<label for="person_type" class="form-label">
|
||||
<div class="row mb-3">
|
||||
<label for="person_type" class="form-label col-md-2">
|
||||
Population
|
||||
</label>
|
||||
<select
|
||||
name="person_type"
|
||||
id="person_type"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for Key, Value in PersonTypes %}
|
||||
<option value="{{ Key }}">{{ Value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-md-10">
|
||||
<select
|
||||
name="person_type"
|
||||
id="person_type"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for Key, Value in PersonTypes %}
|
||||
<option value="{{ Key }}">{{ Value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="field_type" class="form-label">
|
||||
<div class="row mb-3">
|
||||
<label for="field_type" class="form-label col-md-2">
|
||||
Type de champ
|
||||
</label>
|
||||
<select
|
||||
name="field_type"
|
||||
id="field_type"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for Key, Value in FieldTypes %}
|
||||
<option value="{{ Key }}">{{ Value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-md-10">
|
||||
<select
|
||||
name="field_type"
|
||||
id="field_type"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for Key, Value in FieldTypes %}
|
||||
<option value="{{ Key }}">{{ Value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="list" class="form-label">
|
||||
<div class="row mb-3">
|
||||
<label for="list" class="form-label col-md-2">
|
||||
Liste
|
||||
</label>
|
||||
<select
|
||||
name="list"
|
||||
id="list"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for List in Lists %}
|
||||
<option value="{{ List.ID }}">
|
||||
{{ List.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-md-10">
|
||||
<select
|
||||
name="list"
|
||||
id="list"
|
||||
class="form-control"
|
||||
required
|
||||
>
|
||||
{% for List in Lists %}
|
||||
<option value="{{ List.ID }}">
|
||||
{{ List.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="my-4">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="me-1 bi-floppy"></i>
|
||||
Enregistrer
|
||||
|
|
@ -118,6 +126,10 @@
|
|||
var enable = false;
|
||||
if ($(this).val() == "list") {
|
||||
enable = true;
|
||||
|
||||
$("#list-disabled").remove();
|
||||
} else {
|
||||
$("#list").append("<option id=\"list-disabled\" selected></option>");
|
||||
}
|
||||
|
||||
$("#list").prop("disabled", !enable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue