summaryrefslogtreecommitdiffstats
path: root/template/en
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-06-21 21:33:40 +0200
committermkanat%bugzilla.org <>2009-06-21 21:33:40 +0200
commit6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f (patch)
tree09210e7401d57785effcc9b8bd86c2642f8a1d8d /template/en
parent4c3c583a411a59ae42df2652c8122fcfd5364c52 (diff)
downloadbugzilla-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar.gz
bugzilla-6a23b8335dd9e0786cf2c6ea90c8574ac0c6f28f.tar.xz
Bug 463598: Improve the performance of the JavaScript that adjusts field values based on the value of another field
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=mkanat
Diffstat (limited to 'template/en')
-rw-r--r--template/en/default/admin/fieldvalues/confirm-delete.html.tmpl16
-rw-r--r--template/en/default/bug/field-events.js.tmpl12
-rw-r--r--template/en/default/bug/field.html.tmpl5
-rw-r--r--template/en/default/global/user-error.html.tmpl8
4 files changed, 25 insertions, 16 deletions
diff --git a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
index b215edf04..64c24357d 100644
--- a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
+++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
@@ -126,13 +126,15 @@
[% IF value.controlled_values.size %]
<li>This value controls the visibility of the following values in
other fields:<br>
- [% FOREACH controlled = value.controlled_values %]
- <a href="editvalues.cgi?action=edit&field=
- [%- controlled.field.name FILTER url_quote %]&value=
- [%- controlled.name FILTER url_quote %]">
- [% controlled.field.description FILTER html %]
- ([% controlled.field.name FILTER html %]):
- [%+ controlled.name FILTER html %]</a><br>
+ [% FOREACH field_name = value.controlled_values.keys %]
+ [% FOREACH controlled = value.controlled_values.${field_name} %]
+ <a href="editvalues.cgi?action=edit&field=
+ [%- controlled.field.name FILTER url_quote %]&value=
+ [%- controlled.name FILTER url_quote %]">
+ [% controlled.field.description FILTER html %]
+ ([% controlled.field.name FILTER html %]):
+ [%+ controlled.name FILTER html %]</a><br>
+ [% END %]
[% END %]
</li>
[% END %]
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index 7cdf64687..06fba1245 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -27,10 +27,14 @@
'[% controlled_field.visibility_value.name FILTER js %]');
[% END %]
[% FOREACH legal_value = field.legal_values %]
- [% FOREACH controlled_value = legal_value.controlled_values %]
- showValueWhen('[% controlled_value.field.name FILTER js %]',
- '[% controlled_value.name FILTER js %]',
+ [% FOREACH controlled_field = legal_value.controlled_values.keys %]
+ [% SET cont_ids = [] %]
+ [% FOREACH val = legal_value.controlled_values.$controlled_field %]
+ [% cont_ids.push(val.id) %]
+ [% END %]
+ showValueWhen('[% controlled_field FILTER js %]',
+ [[% cont_ids.join(',') FILTER js %]],
'[% field.name FILTER js %]',
- '[% legal_value.name FILTER js %]');
+ [% legal_value.id FILTER js %]);
[% END %]
[% END %]
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 1d5a194e2..21a73a805 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -134,6 +134,8 @@
[% SET control_value = legal_value.visibility_value %]
[% SET control_field = field.value_field %]
<option value="[% legal_value.name FILTER html %]"
+ id="v[% legal_value.id FILTER html %]_
+ [%- field.name FILTER html %]"
[%# We always show selected values, even if they should be
# hidden %]
[% IF value.contains(legal_value.name).size %]
@@ -144,8 +146,7 @@
%]
class="bz_hidden_option" disabled="disabled"
[% END %]>
- [%- legal_value.name FILTER html -%]
- </option>
+ [%- legal_value.name FILTER html %]</option>
[% END %]
</select>
[%# When you pass an empty multi-select in the web interface,
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 7994b187c..69811f210 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -490,9 +490,11 @@
[% IF vals.size %]
it controls the visibility of the following field values:
<ul>
- [% FOREACH val = vals %]
- <li>[% val.field.name FILTER html %]:
- '[% val.name FILTER html %]'</li>
+ [% FOREACH field_name = vals.keys %]
+ [% FOREACH val = vals.${field_name} %]
+ <li>[% val.field.name FILTER html %]:
+ '[% val.name FILTER html %]'</li>
+ [% END %]
[% END %]
</ul>
[% END %]