summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-04-30 08:06:06 +0200
committerByron Jones <glob@mozilla.com>2015-04-30 08:06:06 +0200
commitdac9873a61b108133ee00bda5b1862404712dd63 (patch)
treee54a93f442672073ce6ee48e0979580ca0e2e1e1 /extensions/BugModal/template
parent0d154533510e72467e1073c52095a1622f04f334 (diff)
downloadbugzilla-dac9873a61b108133ee00bda5b1862404712dd63.tar.gz
bugzilla-dac9873a61b108133ee00bda5b1862404712dd63.tar.xz
Bug 1151745: add ui to minimise steps required to move bugs between products
Diffstat (limited to 'extensions/BugModal/template')
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl30
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/field.html.tmpl3
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/header.html.tmpl1
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/new_product_groups.html.tmpl59
4 files changed, 90 insertions, 3 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index da7f2f294..63bd72dc6 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -233,7 +233,7 @@
Fetching
</span>
</button>
- <button type="submit" id="commit-btn" class="major" style="display:none">Save Changes</button>
+ <button type="submit" id="commit-btn" class="save-btn major" style="display:none">Save Changes</button>
</div>
[% END %]
<div class="button-row">
@@ -265,26 +265,50 @@
[% WRAPPER fields_lhs %]
[%# product %]
+ [% can_edit_product = bug.check_can_change_field("product", 0, 1) %]
[% WRAPPER bug_modal/field.html.tmpl
field = bug_fields.product
field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ hide_on_edit = can_edit_product
%]
+ <span class="spin-latch" id="product-latch" data-latch="#product-latch" data-for="#product-info">&#9656;</span>
<div class="spin-toggle" data-latch="#product-latch" data-for="#product-info">
- <span class="spin-latch" id="product-latch">&#9656;</span>
[% bug.product FILTER html %]
</div>
<div id="product-info" style="display:none">
[% bug.product_obj.description FILTER html_light %]
</div>
[% END %]
+ [% WRAPPER bug_modal/field.html.tmpl
+ field = bug_fields.product
+ field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ hide_on_view = 1
+ hide_on_edit = !can_edit_product
+ append_content = 1
+ %]
+ <span id="product-search-container">
+ [% PROCESS prodcompsearch/form.html.tmpl
+ id = "pcs"
+ custom_select = 1
+ hidden = 1
+ throbber = "product-throbber"
+ %]
+ <button id="product-search" type="button" class="minor">Search</button>
+ <button id="product-search-cancel" type="button" class="minor" style="display:none">X</button>
+ <img id="product-throbber" src="extensions/BugModal/web/throbber.gif"
+ width="16" height="11" style="display:none">
+ <img id="product-search-error" class="tt" src="extensions/BugModal/web/error.png"
+ width="16" height="16" style="display:none">
+ </span>
+ [% END %]
[%# component %]
[% WRAPPER bug_modal/field.html.tmpl
field = bug_fields.component
field_type = constants.FIELD_TYPE_SINGLE_SELECT
%]
+ <span class="spin-latch" id="component-latch" data-latch="#component-latch" data-for="#component-info">&#9656;</span>
<div class="spin-toggle" data-latch="#component-latch" data-for="#component-info">
- <span class="spin-latch" id="component-latch">&#9656;</span>
[% bug.component FILTER html %]
</div>
<div id="component-info" style="display:none">
diff --git a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
index 089543c39..9327069da 100644
--- a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
@@ -74,6 +74,9 @@ END;
IF !editable && edit_only;
edit_only = 0;
END;
+IF hide_on_view && hide_on_edit;
+ RETURN;
+END;
%]
<div class="field
diff --git a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
index 6ba7ede8b..1fc00e82f 100644
--- a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
@@ -49,6 +49,7 @@
# assets
javascript_urls.push(
+ "extensions/ProdCompSearch/web/js/prod_comp_search.js",
"extensions/BugModal/web/time_ago.js",
"extensions/BugModal/web/bug_modal.js",
"extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js",
diff --git a/extensions/BugModal/template/en/default/bug_modal/new_product_groups.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/new_product_groups.html.tmpl
new file mode 100644
index 000000000..29658faed
--- /dev/null
+++ b/extensions/BugModal/template/en/default/bug_modal/new_product_groups.html.tmpl
@@ -0,0 +1,59 @@
+[%# 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.
+ #%]
+
+[%#
+ # product: product object
+ # groups:
+ # invalid => [{ id, name, description, checked }...]
+ # mandatory => "
+ # optional => "
+ #%]
+
+[% PROCESS group_list
+ group_set = groups.invalid
+ label = "Groups that are not valid for the '" _ product.name _ "' product:"
+ enabled = 0
+ disabled = 1
+%]
+[% PROCESS group_list
+ group_set = groups.mandatory
+ label = "Mandatory '" _ product.name _ "' groups:"
+ enabled = 1
+ disabled = 1
+%]
+[% PROCESS group_list
+ group_set = groups.optional
+ label = "Optional '" _ product.name _ "' groups:"
+ enabled = 1
+ disabled = 0
+%]
+<input type="hidden" name="group_verified" value="1">
+
+[% BLOCK group_list %]
+ [% RETURN UNLESS group_set.size %]
+ [% FILTER collapse %]
+ <div>
+ <div>
+ [% label FILTER html %]
+ </div>
+
+ [% FOREACH g = group_set %]
+ <div>
+ <input type="checkbox" value="[% g.name FILTER html %]"
+ id="group_[% g.id FILTER none %]"
+ [%= IF enabled %]name="groups"[% END %]
+ [%= "checked" IF g.checked %]
+ [%= "disabled" IF disabled %]>
+ <label for="group_[% g.id FILTER none %]" [%= IF disabled %]class="group-disabled"[% END %]>
+ [% g.description FILTER html %]
+ </label>
+ </div>
+ [% END %]
+ </div>
+ [% END %]
+[% END %]