summaryrefslogtreecommitdiffstats
path: root/extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl
blob: 83c8d729a1d648b960fe033d48a96860323acea8 (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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
[%# 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.
  #%]

<link href="[% "extensions/BugmailFilter/web/style/bugmail-filter.css" FILTER mtime %]"
      rel="stylesheet" type="text/css">
<script type="text/javascript"
        src="[% "extensions/BugmailFilter/web/js/bugmail-filter.js" FILTER mtime %]"></script>

[% SET selectable_products = user.get_selectable_products %]
[% SET dont_show_button = 1 %]

<script>
var useclassification = false;
var first_load = true;
var last_sel = [];
var cpts = new Array();
[% n = 1 %]
[% FOREACH prod = selectable_products %]
  cpts['[% n %]'] = [
    [%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  [% n = n + 1 %]
[% END %]
</script>
<script type="text/javascript" src="[% 'js/productform.js' FILTER mtime FILTER html %]">
</script>

<hr>
<b>Bugmail Filtering</b>

<p>
  You can instruct [% terms.Bugzilla %] to filter bugmail based on the field
  that was changed.
</p>

<table id="add_filter_table">
<tr>
  <th>Field:</th>
  <td>
    <select name="field" id="field">
      <option value="">__Any__</option>
      [% FOREACH field = fields %]
        <option value="[% field.name FILTER html %]">
          [% field.description FILTER html %]
        </option>
      [% END %]
    </select>
  </td>
  <td class="blurb">
    the field that was changed
  </td>
</tr>
<tr>
  <th>Product:</th>
  <td>
    <select name="product" id="product" onChange="onFilterProductChange()">
      <option value="">__Any__</option>
      [% FOREACH product IN selectable_products %]
        <option>[% product.name FILTER html %]</option>
      [% END %]
    </select>
  </td>
  <td class="blurb">
    the [% terms.bug %]'s current product
  </td>
</tr>
<tr>
  <th>Component:</th>
  <td>
    <select name="component" id="component">
      <option value="">__Any__</option>
      [% FOREACH product IN selectable_products %]
        [% FOREACH component IN product.components %]
          <option>[% component.name FILTER html %]</option>
        [% END %]
      [% END %]
    </select>
  </td>
  <td class="blurb">
    the [% terms.bug %]'s current component
  </td>
</tr>
<tr>
  <th>Relationship:</th>
  <td>
    <select name="relationship" id="relationship">
      <option value="">__Any__</option>
      [% FOREACH rel IN relationships %]
        <option value="[% rel.value FILTER html %]">
          [% rel.name FILTER html %]
        </option>
      [% END %]
    </select>
  </td>
  <td class="blurb">
    your relationship with the [% terms.bug %]
  </td>
</tr>
<tr>
  <th>Action:</th>
  <td>
    <select name="action" id="action">
      <option></option>
      <option>Exclude</option>
      <option>Include</option>
    </select>
  </td>
  <td class="blurb">
    action to take when all conditions match
  </td>
</tr>
<tr>
  <td></td>
  <td><input type="submit" id="add_filter" name="add_filter" value="Add"></td>
</tr>
</table>

<hr>
<p>
  You are currently filtering on:
</p>

[% IF filters.size %]

  <table id="filters_table">
    <tr>
      <td></td>
      <th>Product</th>
      <th>Component</th>
      <th>Field</th>
      <th>Relationship</th>
      <th>Action</th>
    </tr>
    [% FOREACH filter = filters %]
      <tr class="[% "row_odd" UNLESS loop.count % 2 %]">
        <td>
          <input type="checkbox" name="remove" value="[% filter.id FILTER none %]"
                 onChange="onRemoveChange()">
        </td>
        <td>[% filter.product ? filter.product.name : 'Any' FILTER html %]</td>
        <td>[% filter.component ? filter.component.name : 'Any' FILTER html %]</td>
        <td>[% filter.field ? filter.field.description : 'Any' FILTER html %]</td>
        <td>[% filter.relationship ? filter.relationship_name : 'Any' FILTER html %]</td>
        <td>[% filter.action ? 'Exclude' : 'Include' %]</td>
      </tr>
    [% END %]
    <tr>
      <td></td>
      <td><input id="remove" name="remove_filter" type="submit" value="Remove Selected"></td>
    </tr>
  </table>

[% ELSE %]

  <p>
    <i>You do not have any filters configured.</i>
  </p>

[% END %]

<hr>
<p>
  This feature provides fine-grained control over what changes to [% terms.bugs
  %] will result in an email notification.  These filters are applied
  <b>after</b> the rules configured on the
  <a href="userprefs.cgi?tab=email">Email Preferences</a> tab.
</p>
<p>
  If multiple filters are applicable to the same [% terms.bug %] change,
  <b>include</b> filters override <b>exclude</b> filters.
</p>
<p>
  Examples:
</p>
<p>
  To never receive changes made to the "QA Whiteboard" field for [% terms.bugs %]
  where you are not the assignee:<br>
  <table class="example_filter_table">
    <tr>
      <th>Field:</th>
      <td>QA Whiteboard</td>
    </tr>
    <tr>
      <th>Product:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Component:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Relationship:</th>
      <td>Not Assignee</td>
    </tr>
    <tr>
      <th>Action:</th>
      <td>Exclude</td>
    </tr>
  </table>
</p>
<p>
  To receive just comments made to Firefox [% terms.bugs %], and no other
  changes, you require two filters.  First an <b>exclude</b> filter to drop all
  changes made to [% terms.bugs %] in that product:<br>
  <table class="example_filter_table">
    <tr>
      <th>Field:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Product:</th>
      <td>Firefox</td>
    </tr>
    <tr>
      <th>Component:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Relationship:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Action:</th>
      <td>Exclude</td>
    </tr>
  </table>
  <br>
  Then an <b>include</b> filter to indicate that you want to receive
  comments:<br>
  <table class="example_filter_table">
    <tr>
      <th>Field:</th>
      <td>Comment Created</td>
    </tr>
    <tr>
      <th>Product:</th>
      <td>Firefox</td>
    </tr>
    <tr>
      <th>Component:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Relationship:</th>
      <td>__Any__</td>
    </tr>
    <tr>
      <th>Action:</th>
      <td>Include</td>
    </tr>
  </table>
</p>