5 [%- SET var_name = HTML.escape(name_prefix) _ "cvar_" _ HTML.escape(var.name) _ HTML.escape(name_postfix) -%]
7 [%- IF hide_non_editable && !var.flag_editable %]
8 <input type="hidden" name="[% var_name %]" value="[% HTML.escape(var.value) %]">
10 [%- ELSIF !var.valid %]
11 [%- IF show_disabled_message %]
12 <i>[% 'Element disabled' | $T8 %]</i>
15 [%- ELSIF var.type == 'bool' %]
16 <input type="checkbox" name="[% var_name %]" value="1"[% IF var.value %] checked[% END %]>
18 [%- ELSIF var.type == 'textfield' %]
19 <textarea name="[% var_name %]" cols="[% HTML.escape(var.width) %]" rows="[% HTML.escape(var.height) %]">[% HTML.escape(var.value) %]</textarea>
21 [%- ELSIF var.type == 'date' %]
22 [% L.date_tag(var_name, var.value) %]
24 [%- ELSIF var.type == 'timestamp' %]
25 <input name="[% var_name %]" value="[% HTML.escape(var.value) %]">
27 [%- ELSIF var.type == 'customer' %]
28 [% L.customer_picker(var_name, var.value) %]
30 [%- ELSIF var.type == 'vendor' %]
31 [% L.vendor_selector(var_name, var.value) %]
33 [%- ELSIF var.type == 'part' %]
34 [% L.part_selector(var_name, var.value) %]
36 [%- ELSIF var.type == 'select' %]
38 <select name="[% var_name %]">
39 [%- FOREACH option = var.OPTIONS %]
40 <option value="[% option.value | html %]"[% IF option.value == var.value %] selected[% END %]>[% HTML.escape(option.value) %]</option>
45 <input name="[% var_name %]" value="[% HTML.escape(var.value) %]" [%- IF var.maxlength %] maxlength="[% HTML.escape(var.maxlength) %]"[% END -%]>