summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin/flag-type/list.html.tmpl
blob: a3d26a0d0d7fd83b7c2b640c5d547d9a38e175dd (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
[%# 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.
  #%]

[% PROCESS "global/js-products.html.tmpl" %]

[% PROCESS global/header.html.tmpl
  title = 'Administer Flag Types'
  style_urls = ['skins/standard/admin.css']
  onload="var f = document.flagtype_form; selectProduct(f.product, f.component, null, null, '__All__');"
  javascript_urls=["js/productform.js"]
  doc_section = "flags-overview.html#flag-types"
%]

<p>
  Flags are markers that identify whether [% terms.abug %] or attachment has been granted
  or denied some status.  Flags appear in the UI as a name and a status symbol
  ("+" for granted, "-" for denied, and "?" for statuses requested by users).
</p>

<p>
  For example, you might define a "review" status for users to request review
  for their patches.  When a patch writer requests review, the string "review?"
  will appear in the attachment.  When a patch reviewer reviews the patch,
  either the string "review+" or the string "review-" will appear in the patch,
  depending on whether the patch passed or failed review.
</p>

<p>
  You can restrict the list of flag types to those available for a given product
  and component. If a product is selected with no component, only flag types
  which are available to at least one component of the product are shown.
</p>

<form id="flagtype_form" name="flagtype_form" action="editflagtypes.cgi" method="get">
  <table>
    <tr>
      <th><label for="product">Product:</label></th>
      <td>
        <select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
          <option value="">__Any__</option>
          [% FOREACH prod = products %]
            <option value="[% prod.name FILTER html %]"
                    [% " selected" IF selected_product == prod.name %]>
                    [% prod.name FILTER html %]</option>
          [% END %]
        </select>
      </td>
      <th><label for="component">Component:</label></th>
      <td>
        <select name="component">
          <option value="">__Any__</option>
          [% FOREACH comp = components %]
            <option value="[% comp FILTER html %]"
                    [% " selected" IF selected_component == comp %]>
                    [% comp FILTER html %]</option>
          [% END %]
        </select>
      </td>
      <td>
        <input type="checkbox" id="show_flag_counts" name="show_flag_counts" value="1"
               [%+ 'checked="checked"' IF show_flag_counts %]>
        <label for="show_flag_counts">Show flag counts</label>
      </td>
      <td><input type="submit" id="submit" value="Filter"></td>
    </tr>
  </table>
</form>

<h3>Flag Types for [% terms.Bugs %]</h3>

[% PROCESS display_flag_types types=bug_types types_id='bugs' %]

<p>
  <a href="editflagtypes.cgi?action=enter&amp;target_type=bug">Create Flag Type for [% terms.Bugs %]</a>
</p>

<h3>Flag Types for Attachments</h3>

[% PROCESS display_flag_types types=attachment_types types_id='attachments' %]

<p>
  <a href="editflagtypes.cgi?action=enter&amp;target_type=attachment">Create Flag Type For Attachments</a>
</p>

[% PROCESS global/footer.html.tmpl %]


[% BLOCK display_flag_types %]
  <table id="flag_types_[% types_id FILTER html %]" cellspacing="0" cellpadding="4" border="1">

    <tr class="column_header">
      <th>Edit name ...</th>
      <th>Description</th>
      <th>Sortkey</th>
      <th>Properties</th>
      <th>Grant group</th>
      <th>Request group</th>
      [% IF show_flag_counts %]
        <th>Flags</th>
        [%# Note to translators: translate the strings in quotes only. %]
        [% state_desc = {granted = 'granted' denied = 'denied' pending = 'pending'} %]
      [% END %]
      <th>Actions</th>
    </tr>

    [% FOREACH type = types %]

      <tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]">
        <td><a href="editflagtypes.cgi?action=edit&amp;id=[% type.id %]">[% type.name FILTER html FILTER no_break %]</a></td>
        <td>[% type.description FILTER html %]</td>
        <td align="right">[% type.sortkey FILTER html %]</td>
        <td>
          [% IF type.is_requestable %]
            <span class="requestable">requestable</span>
          [% END %]
          [% IF type.is_requestable && type.is_requesteeble %]
            <span class="requesteeble">(specifically)</span>
          [% END %]
          [% IF type.is_multiplicable %]
            <span class="multiplicable">multiplicable</span>
          [% END %]
        </td>
        <td>[% IF type.grant_group %][% type.grant_group.name FILTER html %][% END %]</td>
        <td>[% IF type.request_group %][% type.request_group.name FILTER html %][% END %]</td>
        [% IF show_flag_counts %]
          <td>
            [% FOREACH state = ['granted', 'pending', 'denied'] %]
              [% bug_list = bug_lists.${type.id}.$state || [] %]
              [% IF bug_list.size %]
                <a href="buglist.cgi?bug_id=[% bug_list.unique.nsort.join(",") FILTER html %]">
                  [% bug_list.size FILTER html %] [%+ state_desc.$state FILTER html %]
                </a>
                <br>
              [% ELSE %]
                0 [% state_desc.$state FILTER html %]<br>
              [% END %]
            [% END %]
          </td>
        [% END %]
        <td>
          <a href="editflagtypes.cgi?action=copy&amp;id=[% type.id %]">Copy</a>
          | <a href="editflagtypes.cgi?action=confirmdelete&amp;id=[% type.id %]">Delete</a>
        </td>
      </tr>

    [% END %]

  </table>
[% END %]