[% PROCESS elements.html %]

[% text('System Defaults') %]
[% FOREACH GROUP IN default_settings %]
[% GROUP.title %]
[% FOREACH ITEM IN GROUP.items %]
[% ITEM.label %] | [% IF ITEM.name == 'password_duration'; PROCESS input element_data = { name = ITEM.name, type = 'text', value = form.${ITEM.name}, size = 5, 'data-dojo-type' = 'dijit/form/NumberTextBox', 'data-dojo-props' = 'constraints:{min:0.00001,max:3653}', }; ELSIF ITEM.type == 'YES_NO' OR ITEM.type == 'YES_NO_AUTO'; IF form.${ITEM.name} == 'auto'; AUTO="CHECKED"; YES=undef; NO=undef; ELSIF form.${ITEM.name}; AUTO=undef YES="CHECKED"; NO=undef; ELSE; AUTO=undef NO="CHECKED"; YES=undef; END; PROCESS input element_data = { name = ITEM.name id = ITEM.name _ '-yes' type = 'radio' label = text('Yes') value = 1 checked = YES }; PROCESS input element_data = { name = ITEM.name id = ITEM.name _ '-no' type = 'radio' label = text('No') value = 0 checked = NO }; IF ITEM.type == 'YES_NO_AUTO'; PROCESS input element_data = { name = ITEM.name id = ITEM.name _ '-auto' type = 'radio' label = text('Automatic') value = 'auto' checked = AUTO }; END; ELSIF ITEM.type == 'SELECT_ONE'; PROCESS select element_data= selects.${ITEM.name}; ELSIF ITEM.type == 'TEXTAREA'; PROCESS textarea element_data = { rows = 3 cols = 33 text = form.${ITEM.name} name = ITEM.name }; ELSE; PROCESS input element_data = { name = ITEM.name type = 'text' value = form.${ITEM.name} }; END; IF ITEM.info; " | "; FOREACH i IN ITEM.info; i = i.replace('\$1','Historical currency converter web service'); "$i "; END; ""; END; %]
[% END # FOREACH ITEM %] [% END # FOREACH GROUP %]

[% FOREACH hidden IN hiddens.keys; PROCESS input element_data={ type => 'hidden', name => hidden, value => hiddens.item(hidden) }; END; PROCESS button element_data={ name => '__action' value => 'save_defaults' text => text('Save')} %]