summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template/en/default/bug_modal/new_product_groups.html.tmpl
blob: 29658faedfa3773f08bb55a6974f8616cbade1dd (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
[%# 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 %]