diff --git a/config.html b/config.html index 6f9c811..3cb2593 100644 --- a/config.html +++ b/config.html @@ -14,14 +14,8 @@ {{:assign var="labels" value=$_POST.input_fields.label}} {{:assign var="owner_keys" value=$_POST.input_fields.owner|keys}} -{{#foreach from=$labels item="label"}} - {{if $label|in:$owner_keys}} - {{* label présent *}} - {{:assign var="input_fields." label=$label|trim owner=1|boolval}} - {{else}} - {{* label absent *}} - {{:assign var="input_fields." label=$label|trim owner=0|boolval}} - {{/if}} +{{#foreach from=$_POST.input_fields|array_transpose item="field"}} + {{:assign var="input_fields." label=$field.label|trim owner=$field.owner|boolval}} {{/foreach}} {{:save key="config" @@ -56,11 +50,17 @@
{{:button shape="plus" label="Ajouter un champ" - onclick="var a = document.querySelector('.input_fields tbody').lastElementChild; - var b = a.cloneNode(true); - b.querySelector('input[type="text"]').value = null; - b.querySelector('input[type="checkbox"]').checked = false; - a.parentNode.append(b);"}} + onclick="addLine('#input_body')"}}
@@ -98,7 +100,7 @@{{:button shape="plus" label="Ajouter un champ" - onclick="var a = document.querySelector('.output_fields tbody').lastElementChild; - var b = a.cloneNode(true); - b.querySelector('input[type="text"]').value = null; - a.parentNode.append(b);"}} + onclick="addLine('#output_body')"}}
- {{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}} + {{:button + type="submit" + name="save" + label="Enregistrer" + shape="right" + class="main" + onclick="return desactiverCache('#input_body');" + }}
+ {{:admin_footer}}