From edff1af989932ed02af331de928fbf832169f156 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 19 Apr 2011 18:17:11 +0200 Subject: [PATCH] Cvar partial template auf PROCESS umgebaut. Spart bei sehr grossen masken ~5 Sekunden. --- .../webpages/amcvar/render_inputs_block.html | 46 ++++++++----------- templates/webpages/oe/sales_order.html | 2 +- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/templates/webpages/amcvar/render_inputs_block.html b/templates/webpages/amcvar/render_inputs_block.html index bea36c048..996525fba 100644 --- a/templates/webpages/amcvar/render_inputs_block.html +++ b/templates/webpages/amcvar/render_inputs_block.html @@ -1,44 +1,38 @@ [%- USE T8 %] [%- USE HTML %] +[%- BLOCK cvar_name %][% HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix) -%][% END %] [%- BLOCK cvar_inputs %] -[%- var = cvar.var %] -[%- hide_non_editable = cvar.hide_non_editable, %] -[%- name_prefix = cvar.name_prefix, %] -[%- name_postfix = cvar.name_postfix, %] -[%- valid = cvar.valid, %] -[%- value = cvar.value, %] -[%- var_name = HTML.escape(name_prefix) _ "cvar_" _ HTML.escape(var.name) _ HTML.escape(name_postfix) -%] [%- %] -[%- IF hide_non_editable && !var.flag_editable %] - -[%- ELSIF !valid %] +[%- IF cvar.hide_non_editable && !cvar.var.flag_editable %] + +[%- ELSIF !cvar.valid %] [%- IF show_disabled_message %] [% 'Element disabled' | $T8 %] [%- END %] -[%- ELSIF var.type == 'bool' %] - -[%- ELSIF var.type == 'textfield' %] - -[%- ELSIF var.type == 'date' %] - - +[%- ELSIF cvar.var.type == 'bool' %] + +[%- ELSIF cvar.var.type == 'textfield' %] + +[%- ELSIF cvar.var.type == 'date' %] + + -[%- ELSIF var.type == 'timestamp' %] - -[%- ELSIF var.type == 'select' %] - +[%- ELSIF cvar.var.type == 'select' %] + [%- ELSE %] - + [%- END %] [%- END %] diff --git a/templates/webpages/oe/sales_order.html b/templates/webpages/oe/sales_order.html index 315d1a9d2..884e4e0c7 100644 --- a/templates/webpages/oe/sales_order.html +++ b/templates/webpages/oe/sales_order.html @@ -30,7 +30,7 @@ [%- IF row2.line_break %]
[%- END %] [%- IF row2.cvar %] [% row2.description %] - [% INCLUDE cvar_inputs cvar = row2.render_options %] + [% PROCESS cvar_inputs cvar = row2.render_options %] [%- ELSE %] [% row2.value %] [%- END %] -- 2.20.1