summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags/template/en/default/hook/bug/edit-after_custom_fields.html.tmpl
blob: e0411b51296c18105a5a89fd8e2e32a877b98f68 (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
[%# 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.
  #%]

[% IF tracking_flags.size %]
  [% FOREACH type = tracking_flag_types %]
    [% flag_list = [] %]
    [% FOREACH flag = tracking_flags %]
      [% flag_list.push(flag) IF flag.flag_type == type.name %]
    [% END %]
    [% IF flag_list.size %]
      <tr>
        <td class="field_label">
          <label>[% type.description FILTER html %]:</label>
        </td>
        <td>
          [% IF bug.check_can_change_field('flagtypes.name', 0, 1) %]
            [% IF user.id && type.collapsed %]
              <span id="edit_[% type.name FILTER html %]_flags_action">
                (<a href="#" name="[% type.name FILTER html %]" class="edit_tracking_flags_link">edit</a>)
              </span>
            [% END %]
            <table class="tracking_flags">
            [% INCLUDE bug/tracking_flags.html.tmpl
               flag_list = flag_list %]
            </table>
            [% IF type.collapsed %]
              <script type="text/javascript">
                TrackingFlags.flags['[% type.name FILTER js %]'] = {};
                [% FOREACH flag = flag_list %]
                  TrackingFlags.flags['[% type.name FILTER js %]']['[% flag.name FILTER js %]'] = '[% flag.bug_flag.value FILTER js %]';
                [% END %]
                TrackingFlags.types.push('[% type.name FILTER js %]');
            </script>
            [% END %]
          [% ELSE %]
            [% FOREACH flag = flag_list %]
              [% NEXT IF flag.status == '---' %]
              [% flag.description FILTER html %]: [% flag.bug_flag.value FILTER html %]<br>
            [% END %]
          [% END %]
        </td>
      </tr>
    [% END %]
  [% END %]
[% END %]

<script type="text/javascript">
  hide_tracking_flags();
</script>