summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/template/en
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-07-10 04:14:03 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-07-10 04:14:03 +0200
commita7c773b9c0aabf6c473c944ec885ba4975e28b4c (patch)
tree404321f144761100636c0a9251d0caf3f9d549a6 /extensions/BMO/template/en
parent108565f882b5fea273687ca32767b7c4d3e28ee8 (diff)
downloadbugzilla-a7c773b9c0aabf6c473c944ec885ba4975e28b4c.tar.gz
bugzilla-a7c773b9c0aabf6c473c944ec885ba4975e28b4c.tar.xz
Bug 771739 - Implement the component search facility from the bmo extension on the browse (describe components) page
r=glob
Diffstat (limited to 'extensions/BMO/template/en')
-rw-r--r--extensions/BMO/template/en/default/global/choose-product.html.tmpl38
-rw-r--r--extensions/BMO/template/en/default/global/prod-comp-search.html.tmpl13
2 files changed, 27 insertions, 24 deletions
diff --git a/extensions/BMO/template/en/default/global/choose-product.html.tmpl b/extensions/BMO/template/en/default/global/choose-product.html.tmpl
index 813a35725..b9cd02cfc 100644
--- a/extensions/BMO/template/en/default/global/choose-product.html.tmpl
+++ b/extensions/BMO/template/en/default/global/choose-product.html.tmpl
@@ -33,17 +33,18 @@
[% IF target == "enter_bug.cgi" %]
[% title = "Enter $terms.Bug" %]
- [% h2 = BLOCK %]First, you must pick a product on which to enter [% terms.abug %]. [% END %]
- [% yui = [ 'autocomplete' ] %]
- [% javascript_urls = [ "js/field.js", "js/create_bug.js",
- "extensions/BMO/web/js/prod_comp_search.js" ] %]
- [% onload = "YAHOO.util.Dom.get('prod_comp_search').focus();" %]
- [% style_urls.push("extensions/BMO/web/styles/prod_comp_search.css") %]
+ [% h2 = "Which product is affected by the problem you would like to report?" %]
[% ELSIF target == "describecomponents.cgi" %]
[% title = "Browse" %]
- [% h2 = "Please specify the product whose components you want described." %]
+ [% h2 = "Which product would you like to have described?" %]
[% END %]
+[% yui = [ 'autocomplete' ] %]
+[% javascript_urls = [ "js/field.js", "js/create_bug.js",
+ "extensions/BMO/web/js/prod_comp_search.js" ] %]
+[% onload = "YAHOO.util.Dom.get('prod_comp_search').focus();" %]
+[% style_urls.push("extensions/BMO/web/styles/prod_comp_search.css") %]
+
[% DEFAULT title = "Choose a Product" %]
[% PROCESS global/header.html.tmpl %]
@@ -57,20 +58,17 @@
</p>
<hr>
-<br>
+<h2>[% h2 FILTER html %]</h2>
+
+[% PROCESS "global/prod-comp-search.html.tmpl" %]
+
+<h2>or choose from the following selections</h2>
+
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
[% SET classification = cgi.param('classification') %]
[% IF NOT ((cgi.param("full")) OR (user.settings.product_chooser.value == 'full_product_chooser')) %]
-[% IF target == 'enter_bug.cgi' %]
-<h2>Which product is affected by the problem you would like to report?</h2>
-[% PROCESS "global/prod-comp-search.html.tmpl" %]
-<h2>or choose from the following selections</h2>
-[% ELSE %]
-<h2>[% h2 FILTER html %]</h2>
-[% END %]
-
<table align="center" border="0" width="600" cellpadding="5" cellspacing="0">
[% INCLUDE easyproduct
name="Core"
@@ -129,14 +127,6 @@
</table>
[% ELSE %]
-[% IF target == 'enter_bug.cgi' %]
-<h2>Which product is affected by the problem you would like to report?</h2>
-[% PROCESS "global/prod-comp-search.html.tmpl" %]
-<h2>or choose from the following selections</h2>
-[% ELSE %]
-<h2>[% h2 FILTER html %]</h2>
-[% END %]
-
<table>
[% FOREACH c = classifications %]
diff --git a/extensions/BMO/template/en/default/global/prod-comp-search.html.tmpl b/extensions/BMO/template/en/default/global/prod-comp-search.html.tmpl
index 8c120e9af..9e5e4da17 100644
--- a/extensions/BMO/template/en/default/global/prod-comp-search.html.tmpl
+++ b/extensions/BMO/template/en/default/global/prod-comp-search.html.tmpl
@@ -23,5 +23,18 @@
{
YAHOO.bugzilla.prodCompSearch.init(
"prod_comp_search", "prod_comp_search_autocomplete_container", "[% format FILTER js %]");
+ [% IF target == "describecomponents.cgi" %]
+ YAHOO.bugzilla.prodCompSearch.autoComplete.itemSelectEvent.subscribe(function (e, args) {
+ var oData = args[2];
+ var url = "describecomponents.cgi?product=" + encodeURIComponent(oData[0]) +
+ "&component=" + encodeURIComponent(oData[1]) +
+ "#" + encodeURIComponent(oData[1]);
+ var format = YAHOO.bugzilla.prodCompSearch.format;
+ if (format) {
+ url += "&format=" + encodeURIComponent(format);
+ }
+ window.location.href = url;
+ });
+ [% END %]
}
</script>