summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/template/en/default/hook/admin
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-07-14 08:52:03 +0200
committerByron Jones <glob@mozilla.com>2015-07-14 08:52:03 +0200
commit425d780e7f77d8cc38191331cbcc84d7af5c871a (patch)
tree31cb71abdccc4d637c35b2769b7840b304a1e91b /extensions/BMO/template/en/default/hook/admin
parent940d6d427109280234dbdad8988b1c3dc7be5969 (diff)
downloadbugzilla-425d780e7f77d8cc38191331cbcc84d7af5c871a.tar.gz
bugzilla-425d780e7f77d8cc38191331cbcc84d7af5c871a.tar.xz
Bug 1173442 - Implement admin UI changes to allow selecting default product security group instead of editing code
Diffstat (limited to 'extensions/BMO/template/en/default/hook/admin')
-rw-r--r--extensions/BMO/template/en/default/hook/admin/products/edit-common-rows.html.tmpl47
1 files changed, 46 insertions, 1 deletions
diff --git a/extensions/BMO/template/en/default/hook/admin/products/edit-common-rows.html.tmpl b/extensions/BMO/template/en/default/hook/admin/products/edit-common-rows.html.tmpl
index 7093bcfc6..f91e4052b 100644
--- a/extensions/BMO/template/en/default/hook/admin/products/edit-common-rows.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/admin/products/edit-common-rows.html.tmpl
@@ -6,8 +6,53 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
+[%
+ group_correct_visibility = {};
+ FOREACH g = product.group_controls.values;
+ IF (g.membercontrol == constants.CONTROLMAPSHOWN)
+ && (g.othercontrol == constants.CONTROLMAPSHOWN);
+ group_correct_visibility.${g.name} = 1;
+ ELSE;
+ group_correct_visibility.${g.name} = 0;
+ END;
+ END;
+%]
+
+<tr>
+ <th align="right">Default Security Group:</th>
+ <td>
+ <select required name="security_group_id" id="security_group_id">
+ <option value=""></option>
+ [% FOREACH g IN security_groups %]
+ <option value="[% g.id FILTER html %]"
+ data-group-correct-visibility="[% group_correct_visibility.${g.name} FILTER none %]"
+ [% " selected" IF product.default_security_group_obj.id == g.id %]>
+ [% g.name FILTER html %]
+ </option>
+ [% END %]
+ </select>
+ <span id="security_group_warning" style="color:red; display:none;">
+ The chosen security group needs to be set to SHOWN/SHOWN for this product
+ </span>
+ <script type="text/javascript">
+ var toggleGroupWarning = function() {
+ var correct_shown = $('#security_group_id option:selected')
+ .data('group-correct-visibility');
+ if (correct_shown) {
+ $('#security_group_warning').hide();
+ }
+ else {
+ $('#security_group_warning').show();
+ }
+ };
+ $('#security_group_id').change(toggleGroupWarning);
+ $(document).ready(toggleGroupWarning);
+ </script>
+ </td>
+</tr>
+
<tr>
- <th align="right">Default Platform</th>
+ <th align="right">Default Platform:</th>
<td>
[% INCLUDE default_select
field_name = 'default_platform_id'