Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision edff1af9

Von Sven Schöling vor mehr als 13 Jahren hinzugefügt

  • ID edff1af989932ed02af331de928fbf832169f156
  • Vorgänger 43a86134
  • Nachfolger b9b068b0

Cvar partial template auf PROCESS umgebaut. Spart bei sehr grossen masken ~5 Sekunden.

Unterschiede anzeigen:

templates/webpages/amcvar/render_inputs_block.html
1 1
[%- USE T8 %]
2 2
[%- USE HTML %]
3
[%- BLOCK cvar_name %][% HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix) -%][% END %]
3 4
[%- BLOCK cvar_inputs %]
4
[%- var               = cvar.var  %]
5
[%- hide_non_editable = cvar.hide_non_editable, %]
6
[%- name_prefix       = cvar.name_prefix, %]
7
[%- name_postfix      = cvar.name_postfix, %]
8
[%- valid             = cvar.valid, %]
9
[%- value             = cvar.value, %]
10
[%- var_name          = HTML.escape(name_prefix) _ "cvar_" _ HTML.escape(var.name) _ HTML.escape(name_postfix) -%]
11 5
[%- %]
12
[%- IF hide_non_editable && !var.flag_editable %]
13
<input type="hidden" name="[% var_name %]" value="[% HTML.escape(var.value) %]">
14
[%- ELSIF !valid %]
6
[%- IF cvar.hide_non_editable && !cvar.var.flag_editable %]
7
<input type="hidden" name="[% PROCESS cvar_name %]" value="[% HTML.escape(cvar.var.value) %]">
8
[%- ELSIF !cvar.valid %]
15 9
  [%- IF show_disabled_message %]
16 10
<i>[% 'Element disabled' | $T8 %]</i>
17 11
  [%- END %]
18
[%- ELSIF var.type == 'bool' %]
19
<input type="checkbox" name="[% var_name %]" value="1"[% IF value %] checked[% END %]>
20
[%- ELSIF var.type == 'textfield' %]
21
<textarea name="[% var_name %]" cols="[% HTML.escape(var.width) %]" rows="[% HTML.escape(var.height) %]">[% HTML.escape(value) %]</textarea>
22
[%- ELSIF var.type == 'date' %]
23
<input name="[% var_name %]" id="[% var_name %]" size="12" value="[% HTML.escape(value) %]">
24
<input name="[% var_name %]_button" id="[% var_name %]_trigger" type="button" value="?">
12
[%- ELSIF cvar.var.type == 'bool' %]
13
<input type="checkbox" name="[% PROCESS cvar_name %]" value="1"[% IF cvar.value %] checked[% END %]>
14
[%- ELSIF cvar.var.type == 'textfield' %]
15
<textarea name="[% PROCESS cvar_name %]" cols="[% HTML.escape(cvar.var.width) %]" rows="[% HTML.escape(cvar.var.height) %]">[% HTML.escape(cvar.value) %]</textarea>
16
[%- ELSIF cvar.var.type == 'date' %]
17
<input name="[% PROCESS cvar_name %]" id="[% PROCESS cvar_name %]" size="12" value="[% HTML.escape(cvar.value) %]">
18
<input name="[% PROCESS cvar_name %]_button" id="[% PROCESS cvar_name %]_trigger" type="button" value="?">
25 19
<script type="text/javascript">
26 20
 <!--
27
     Calendar.setup({ inputField : "[% var_name %]",
21
     Calendar.setup({ inputField : "[% PROCESS cvar_name %]",
28 22
                      ifFormat   : "[% myconfig_jsc_dateformat %]",
29 23
                      align      : "BR",
30
                      button     : "[% var_name %]_trigger" });
24
                      button     : "[% PROCESS cvar_name %]_trigger" });
31 25
   -->
32 26
</script>
33
[%- ELSIF var.type == 'timestamp' %]
34
<input name="[% var_name %]" value="[% HTML.escape(value) %]">
35
[%- ELSIF var.type == 'select' %]
36
<select name="[% var_name %]">
37
 [%- FOREACH option = var.OPTIONS %]
38
 <option[% IF option.value == value %] selected[% END %]>[% HTML.escape(option.value) %]</option>
27
[%- ELSIF cvar.var.type == 'timestamp' %]
28
<input name="[% PROCESS cvar_name %]" value="[% HTML.escape(cvar.value) %]">
29
[%- ELSIF cvar.var.type == 'select' %]
30
<select name="[% PROCESS cvar_name %]">
31
 [%- FOREACH option = cvar.var.OPTIONS %]
32
 <option[% IF option.value == cvar.value %] selected[% END %]>[% HTML.escape(option.value) %]</option>
39 33
 [%- END %]
40 34
</select>
41 35
[%- ELSE %]
42
<input name="[% var_name %]" value="[% HTML.escape(value) %]" [%- IF var.maxlength %] maxlength="[% HTML.escape(var.maxlength) %]"[% END -%]>
36
<input name="[% PROCESS cvar_name %]" value="[% HTML.escape(cvar.value) %]" [%- IF cvar.var.maxlength %] maxlength="[% HTML.escape(cvar.var.maxlength) %]"[% END -%]>
43 37
[%- END %]
44 38
[%- END %]
templates/webpages/oe/sales_order.html
30 30
   [%- IF row2.line_break %]<br/>[%- END %]
31 31
   [%- IF row2.cvar %]
32 32
     [% row2.description %]
33
     [% INCLUDE cvar_inputs cvar = row2.render_options %]
33
     [% PROCESS cvar_inputs cvar = row2.render_options %]
34 34
   [%- ELSE %]
35 35
     [% row2.value %]
36 36
   [%- END %]

Auch abrufbar als: Unified diff