summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-03-12 19:41:17 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-03-12 19:41:17 +0100
commit40a7a3f2d4f196e9cd52defce04c34a65910ed74 (patch)
treea54c2f01276d0f1932feb1b0cedbc7688a5bc8ed
parent4047c7ba791ee4a6e901de97f280e687b4e297f3 (diff)
downloadbugzilla-40a7a3f2d4f196e9cd52defce04c34a65910ed74.tar.gz
bugzilla-40a7a3f2d4f196e9cd52defce04c34a65910ed74.tar.xz
Bug 837878 - Display product and component info in show_bug.cgi
r=glob
-rw-r--r--extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl54
-rw-r--r--extensions/BMO/web/styles/edit_bug.css11
2 files changed, 65 insertions, 0 deletions
diff --git a/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl
new file mode 100644
index 000000000..c177015f1
--- /dev/null
+++ b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl
@@ -0,0 +1,54 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ #
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
+ #%]
+
+[%# Display product and component descriptions after their respective fields %]
+<script type="text/javascript">
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use('node', 'event', function(Y) {
+ // Display product description if user requests it
+ Y.on('contentready', function() {
+ var field_container = Y.one('#field_container_product');
+ field_container.appendChild('<span id="toggle_prod_desc">' +
+ '&nbsp;(<a href="javascript:void(0);" id="toggle_prod_desc_link">show info</a>)' +
+ '</span>');
+ field_container.appendChild('<div class="bz_default_hidden" id="prod_desc_container">' +
+ '[% bug.product_obj.description FILTER html_light FILTER js %]</div>');
+ Y.on('click', function() {
+ if (Y.one('#prod_desc_container').hasClass('bz_default_hidden')) {
+ Y.one('#toggle_prod_desc_link').set('innerHTML', 'hide info');
+ Y.one('#prod_desc_container').removeClass('bz_default_hidden');
+ }
+ else {
+ Y.one('#toggle_prod_desc_link').set('innerHTML', 'show info');
+ Y.one('#prod_desc_container').addClass('bz_default_hidden');
+ }
+ }, '#toggle_prod_desc_link');
+ }, '#field_container_product');
+ // Display component description if user requests it
+ Y.on('contentready', function() {
+ var field_container = Y.one('#field_container_component');
+ field_container.appendChild('<span id="toggle_comp_desc">' +
+ '&nbsp;(<a href="javascript:void(0);" id="toggle_comp_desc_link">show info</a>)' +
+ '</span>');
+ field_container.appendChild('<div class="bz_default_hidden" id="comp_desc_container">' +
+ '[% bug.component_obj.description FILTER html_light FILTER js %]</div>');
+ Y.on('click', function() {
+ if (Y.one('#comp_desc_container').hasClass('bz_default_hidden')) {
+ Y.one('#toggle_comp_desc_link').set('innerHTML', 'hide info');
+ Y.one('#comp_desc_container').removeClass('bz_default_hidden');
+ }
+ else {
+ Y.one('#toggle_comp_desc_link').set('innerHTML', 'show info');
+ Y.one('#comp_desc_container').addClass('bz_default_hidden');
+ }
+ }, '#toggle_comp_desc_link');
+ }, '#field_container_component');
+ });
+</script>
diff --git a/extensions/BMO/web/styles/edit_bug.css b/extensions/BMO/web/styles/edit_bug.css
index 089a92fbb..24212270d 100644
--- a/extensions/BMO/web/styles/edit_bug.css
+++ b/extensions/BMO/web/styles/edit_bug.css
@@ -36,3 +36,14 @@
font-family: monospace;
}
+#prod_desc_container,
+#comp_desc_container {
+ overflow: auto;
+ color: green;
+ padding: 2px;
+}
+
+#toggle_prod_desc,
+#toggle_comp_desc {
+ white-space: nowrap;
+}