blob: 5486684f1b58c18b8b181ae4b752fe51ba0805ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
[%# 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.
#%]
[%
group_correct_visibility = {};
FOREACH g = product.group_controls.values;
group_correct_visibility.${g.name} =
(g.membercontrol == constants.CONTROLMAPNA) || (g.othercontrol == constants.CONTROLMAPNA) ? 0 : 1;
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;">
This security group needs to be set to SHOWN/SHOWN
</span>
<script>
var toggleGroupWarning = function() {
var correct_shown = $('#security_group_id option:selected').data('group-correct-visibility');
if ($('#security_group_id').val() === '' || 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>
<td>
[% INCLUDE default_select
field_name = 'default_platform_id'
field_value = product.default_platform_id
field_values = bug_fields.rep_platform.legal_values
%]
[%= INCLUDE default_select
field_name = 'default_op_sys_id'
field_value = product.default_op_sys_id
field_values = bug_fields.op_sys.legal_values
%]
</td>
</tr>
[% BLOCK default_select %]
<select name="[% field_name FILTER html %]">
<option value="" [% " selected" IF field_value == "" %]>Detect</option>
[% FOREACH v IN field_values %]
[% NEXT UNLESS v.is_active %]
<option value="[% v.id FILTER html %]" [% " selected" IF field_value == v.id %]>
[% v.value FILTER html %]
</option>
[% END %]
</select>
[% END %]
|