Mutualisation E/S et petites simplifications
This commit is contained in:
parent
55e649ce0d
commit
262d1935ca
10 changed files with 126 additions and 193 deletions
|
|
@ -9,28 +9,22 @@
|
|||
{{:read file="./defaut.json" assign="config_defaut"}}
|
||||
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||
|
||||
{{if $module.config.input_nature != null}}
|
||||
{{#foreach from=$module.config.input_nature item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.inputs item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{:assign var="directions.input" value="entrée"}}
|
||||
{{:assign var="directions.output" value="sortie"}}
|
||||
|
||||
{{if $module.config.output_nature != null}}
|
||||
{{#foreach from=$module.config.output_nature item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.outputs item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{#foreach from=$directions key="direction"}}
|
||||
{{:assign var="nature" from="module.config.%s_nature"|args:$direction}}
|
||||
{{if $nature != null}}
|
||||
{{#foreach from=$nature item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{:assign var="nature" from="config_defaut.%ss"|args:$direction}}
|
||||
{{#foreach from=$nature item="elem"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue