From a7c773b9c0aabf6c473c944ec885ba4975e28b4c Mon Sep 17 00:00:00 2001
From: Dave Lawrence
Date: Mon, 9 Jul 2012 22:14:03 -0400
Subject: Bug 771739 - Implement the component search facility from the bmo
extension on the browse (describe components) page r=glob
---
.../en/default/global/choose-product.html.tmpl | 38 ++++++++--------------
.../en/default/global/prod-comp-search.html.tmpl | 13 ++++++++
2 files changed, 27 insertions(+), 24 deletions(-)
(limited to 'extensions/BMO/template')
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 @@
-
+[% h2 FILTER html %]
+
+[% PROCESS "global/prod-comp-search.html.tmpl" %]
+
+or choose from the following selections
+
[% 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' %]
-Which product is affected by the problem you would like to report?
-[% PROCESS "global/prod-comp-search.html.tmpl" %]
-or choose from the following selections
-[% ELSE %]
-[% h2 FILTER html %]
-[% END %]
-
[% INCLUDE easyproduct
name="Core"
@@ -129,14 +127,6 @@
[% ELSE %]
-[% IF target == 'enter_bug.cgi' %]
-Which product is affected by the problem you would like to report?
-[% PROCESS "global/prod-comp-search.html.tmpl" %]
-or choose from the following selections
-[% ELSE %]
-[% h2 FILTER html %]
-[% END %]
-
[% 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 %]
}
--
cgit v1.2.3-24-g4f1b