Revision 341a9a36
Von Hans P. Schlaepfer vor fast 5 Jahren hinzugefügt
templates/webpages/amcvar/render_inputs_block.html | ||
---|---|---|
1 |
[%- SET render_cvar_tag_options = {}; |
|
2 |
render_cvar_tag_options.import(cvar_tag_options) IF cvar_tag_options; |
|
3 |
SET cvar_tag_name = HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix); |
|
4 |
IF !render_cvar_tag_options.id && (cvar.var.type != 'select'); |
|
5 |
SET render_cvar_tag_options.no_id = 1; |
|
6 |
END; |
|
7 |
%] |
|
8 | 1 |
[% USE T8 %] |
9 | 2 |
[% USE HTML %] |
10 | 3 |
[% USE L %] |
... | ... | |
12 | 5 |
[% USE LxERP %] |
13 | 6 |
[% USE P %] |
14 | 7 |
|
15 |
[%- IF (!cvar.hide_non_editable || cvar.var.flag_editable) && !cvar.partsgroup_filtered %] |
|
8 |
[% BLOCK cvar_inputs %] |
|
9 |
[% SET render_cvar_tag_options = {}; |
|
10 |
render_cvar_tag_options.import(cvar_tag_options) IF cvar_tag_options; |
|
11 |
SET cvar_tag_name = HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix); |
|
12 |
IF !render_cvar_tag_options.id && (cvar.var.type != 'select'); |
|
13 |
SET render_cvar_tag_options.no_id = 1; |
|
14 |
END; |
|
15 |
%] |
|
16 | 16 |
|
17 |
[%- IF !cvar.valid %] |
|
18 |
[%- IF show_disabled_message %] |
|
19 |
<i>[% 'Element disabled' | $T8 %]</i> |
|
20 |
[%- END %] |
|
17 |
[% IF (!cvar.hide_non_editable || cvar.var.flag_editable) && !cvar.partsgroup_filtered %] |
|
21 | 18 |
|
22 |
[%- ELSIF cvar.var.type == 'bool' %] |
|
23 |
[%- render_cvar_tag_options.import(checked=cvar.value, value=1); |
|
24 |
L.checkbox_tag(cvar_tag_name, render_cvar_tag_options) %] |
|
19 |
[% IF !cvar.valid %] |
|
20 |
[% IF show_disabled_message %] |
|
21 |
<i>[% 'Element disabled' | $T8 %]</i> |
|
22 |
[% END %] |
|
25 | 23 |
|
26 |
[%- ELSIF cvar.var.type == 'textfield' %] |
|
27 |
[% render_cvar_tag_options.import(cols=cvar.var.width, rows=cvar.var.height); |
|
28 |
L.textarea_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
24 |
[% ELSIF cvar.var.type == 'bool' %] |
|
25 |
[% render_cvar_tag_options.import(checked=cvar.value, value=1); L.checkbox_tag(cvar_tag_name, render_cvar_tag_options) %] |
|
29 | 26 |
|
30 |
[%- ELSIF cvar.var.type == 'date' %]
|
|
31 |
[%- L.date_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
27 |
[% ELSIF cvar.var.type == 'textfield' %]
|
|
28 |
[% render_cvar_tag_options.import(cols=cvar.var.width, rows=cvar.var.height); L.textarea_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
32 | 29 |
|
33 |
[%- ELSIF cvar.var.type == 'timestamp' %]
|
|
34 |
[%- L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
30 |
[% ELSIF cvar.var.type == 'date' %]
|
|
31 |
[% L.date_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
35 | 32 |
|
36 |
[%- ELSIF cvar.var.type == 'select' %] |
|
37 |
[%- render_cvar_tag_options.name=cvar_tag_name %] |
|
38 |
<select [% P.stringify_attributes(render_cvar_tag_options) %]> |
|
39 |
[%- IF LxERP.is_rdbo(cvar.var, 'CustomVariableConfig') %] |
|
40 |
[%- FOREACH option = cvar.var.processed_options %] |
|
41 |
[%- SET render_cvar_opts = { |
|
42 |
value = option |
|
43 |
}; |
|
44 |
render_cvar_opts.selected = 'selected' IF option == cvar.value; |
|
45 |
L.html_tag('option', option, render_cvar_opts) %] |
|
46 |
[%- END %] |
|
47 |
[%- ELSE %] |
|
48 |
[%- FOREACH option = cvar.var.OPTIONS %] |
|
49 |
[%- SET render_cvar_opts = { |
|
50 |
value = option.value |
|
51 |
}; |
|
52 |
render_cvar_opts.selected = 'selected' IF option.value == cvar.value; |
|
53 |
L.html_tag('option', option.value, render_cvar_opts) %] |
|
54 |
[%- END %] |
|
55 |
[%- END %] |
|
56 |
</select> |
|
33 |
[% ELSIF cvar.var.type == 'timestamp' %] |
|
34 |
[% L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
57 | 35 |
|
58 |
[%- ELSIF cvar.var.type == 'customer' %] |
|
59 |
[%- render_cvar_tag_options.type = 'customer' %] |
|
60 |
[%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
36 |
[% ELSIF cvar.var.type == 'select' %] |
|
37 |
[% render_cvar_tag_options.name=cvar_tag_name %] |
|
38 |
|
|
39 |
<select [% P.stringify_attributes(render_cvar_tag_options) %]> |
|
40 |
[% IF LxERP.is_rdbo(cvar.var, 'CustomVariableConfig') %] |
|
41 |
[% FOREACH option = cvar.var.processed_options %] |
|
42 |
[% SET render_cvar_opts = { |
|
43 |
value = option |
|
44 |
}; |
|
45 |
render_cvar_opts.selected = 'selected' IF option == cvar.value; |
|
46 |
L.html_tag('option', option, render_cvar_opts) %] |
|
47 |
[% END %] |
|
48 |
[% ELSE %] |
|
49 |
[% FOREACH option = cvar.var.OPTIONS %] |
|
50 |
[% SET render_cvar_opts = { |
|
51 |
value = option.value |
|
52 |
}; |
|
53 |
render_cvar_opts.selected = 'selected' IF option.value == cvar.value; |
|
54 |
L.html_tag('option', option.value, render_cvar_opts) %] |
|
55 |
[% END %] |
|
56 |
[% END %] |
|
57 |
</select> |
|
61 | 58 |
|
62 |
[%- ELSIF cvar.var.type == 'vendor' %]
|
|
63 |
[%- render_cvar_tag_options.type = 'vendor' %]
|
|
64 |
[%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
59 |
[% ELSIF cvar.var.type == 'customer' %]
|
|
60 |
[% render_cvar_tag_options.type = 'customer' %]
|
|
61 |
[% P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
65 | 62 |
|
66 |
[%- ELSIF cvar.var.type == 'part' %] |
|
67 |
[% P.part.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
63 |
[% ELSIF cvar.var.type == 'vendor' %] |
|
64 |
[% render_cvar_tag_options.type = 'vendor' %] |
|
65 |
[% P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
68 | 66 |
|
69 |
[%- ELSIF cvar.var.type == 'number' %]
|
|
70 |
[%- L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %]
|
|
67 |
[% ELSIF cvar.var.type == 'part' %]
|
|
68 |
[% P.part.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
|
|
71 | 69 |
|
72 |
[%- ELSE %] |
|
73 |
[% render_cvar_tag_options.maxlength=cvar.var.maxlength IF cvar.var.maxlength; |
|
74 |
L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
75 |
[%- END %] |
|
70 |
[% ELSIF cvar.var.type == 'number' %] |
|
71 |
[% L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %] |
|
76 | 72 |
|
77 |
[%- END %] |
|
73 |
[% ELSE %] |
|
74 |
[% render_cvar_tag_options.maxlength=cvar.var.maxlength IF cvar.var.maxlength; |
|
75 |
L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %] |
|
76 |
[% END %] |
|
78 | 77 |
|
79 |
[%- END %] |
|
78 |
[% END %] |
|
79 |
|
|
80 |
[% END # BLOCK cvar_inputs %] |
Auch abrufbar als: Unified diff
Neues Design 2019 Standard-Code templates/webpages/amcvar/render_inputs_block.html