summaryrefslogtreecommitdiffstats
path: root/template/en
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-02-28 23:28:17 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-02-28 23:28:17 +0100
commitd9a166a767592ea2f2647f9fca3e43d21f0cd4aa (patch)
tree52374c8c9842fa23336de6dbdffba27f210dc590 /template/en
parent8c6f924b7872555617f861aad1e1184ce6e09dad (diff)
downloadbugzilla-d9a166a767592ea2f2647f9fca3e43d21f0cd4aa.tar.gz
bugzilla-d9a166a767592ea2f2647f9fca3e43d21f0cd4aa.tar.xz
Bug 695514: Slow performance in field-events.js.tmpl on show_bug.cgi with large number of products
r=dkl a=LpSolit
Diffstat (limited to 'template/en')
-rw-r--r--template/en/default/bug/create/create.html.tmpl2
-rw-r--r--template/en/default/bug/field-events.js.tmpl12
-rw-r--r--template/en/default/bug/field.html.tmpl3
3 files changed, 14 insertions, 3 deletions
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 3fdf56472..f3dd680df 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -251,7 +251,7 @@ TUI_hide_default('attachment_text_field');
<script type="text/javascript">
<!--
[%+ INCLUDE "bug/field-events.js.tmpl"
- field = bug_fields.component %]
+ field = bug_fields.component, product = product %]
//-->
</script>
</td>
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index 94dd298f5..13ec18d38 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -19,6 +19,8 @@
[%# INTERFACE:
# field: a Bugzilla::Field object
+ # product: (optional) a Bugzilla::Product object. When specified,
+ # components are restricted to this product.
#%]
[% FOREACH controlled_field = field.controls_visibility_of %]
@@ -29,7 +31,15 @@
[%- END %]
]);
[% END %]
-[% FOREACH legal_value = field.legal_values %]
+
+[% legal_values = [] %]
+[% IF field.name == "component" AND product %]
+ [% legal_values = product.components %]
+[% ELSE %]
+ [% legal_values = field.legal_values %]
+[% END %]
+
+[% FOREACH legal_value = legal_values %]
[% FOREACH controlled_field = legal_value.controlled_values.keys %]
[% SET cont_ids = [] %]
[% FOREACH val = legal_value.controlled_values.$controlled_field %]
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 9c956ea91..681ea716d 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -149,7 +149,8 @@
<script type="text/javascript">
<!--
initHidingOptionsForIE('[% field.name FILTER js %]');
- [%+ INCLUDE "bug/field-events.js.tmpl" field = field %]
+ [%+ INCLUDE "bug/field-events.js.tmpl"
+ field = field, product = bug.product_obj %]
//-->
</script>