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

[%#
  # bug: bug object
  #%]

[%
  PROCESS global/variables.none.tmpl;

  in_all_groups = 1;
  in_a_group = 0;
  FOREACH group IN bug.groups;
    IF NOT group.ingroup;
      in_all_groups = 0;
    END;
    IF group.ison;
      in_a_group = 1;
    END;
  END
%]

<div class="groups edit-hide">
  [% IF in_a_group %]
    <div id="groups-description">
      Only users in all of the following groups can view this [% terms.bug %]:
    </div>
    <ul>
      [% FOREACH group IN bug.groups %]
        [% NEXT UNLESS group.ison || group.mandatory %]
        <li>[% group.description FILTER html %]</li>
      [% END %]
    </ul>
  [% ELSE %]
    This [% terms.bug %] is publicaly visible.
  [% END %]
</div>

<div class="groups edit-show" style="display:none">
  [% emitted_description = 0 %]
  [% FOREACH group IN bug.groups %]
    [% IF NOT emitted_description %]
      [% emitted_description = 1 %]
      <div id="groups-description">
        Only users in all of the selected groups can view this [% terms.bug %]:
      </div>
    [% END %]

    [% IF group.ingroup %]
      <input type="hidden" name="defined_groups" value="[% group.name FILTER html %]">
    [% END %]

    <div class="group">
      <input type="checkbox" value="[% group.name FILTER html %]"
        name="groups" id="group_[% group.bit FILTER html %]"
        [% " checked" IF group.ison %]
        [% " disabled" IF NOT group.ingroup || group.mandatory %]>
      <label for="group_[% group.bit FILTER html %]">
        [%~ group.description FILTER html_light ~%]
      </label>
    </div>
  [% END %]
</div>