summaryrefslogtreecommitdiffstats
path: root/extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl
blob: 32cb55ea15926ef1da70d2191037520b22c963c4 (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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
[%# 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 version %]"
      rel="stylesheet" type="text/css">
<script
        src="[% "extensions/BugmailFilter/web/js/bugmail-filter.js" FILTER version %]"></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 src="[% 'js/productform.js' FILTER version 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 = field_list %]
        <option value="[% field.name FILTER html %]">
          [% field.description FILTER html %]
        </option>
      [% END %]
      <option value="~">Contains:</option>
    </select>
  </td>
  <td class="blurb">
    the field that was changed
  </td>
</tr>
<tr id="field_contains_row" class="bz_default_hidden">
  <td>&nbsp;</td>
  <td>
      <input name="field_contains" id="field_contains"
             placeholder="field name" maxlength="63">
  </td>
</tr>
<tr>
  <th>Product:</th>
  <td>
    <select name="product" id="product">
      <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>Changer:</th>
  <td>
    [% INCLUDE global/userselect.html.tmpl
       id => "changer"
       name => "changer"
       size => 32
       emptyok => 1
    %]
  </td>
  <td class="blurb">
    the person who made the change (leave empty for "anyone")
  </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>Changer</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="onFilterRemoveChange()">
        </td>
        <td>[% filter.product ? filter.product.name : 'Any' FILTER html %]</td>
        <td>[% filter.component ? filter.component.name : 'Any' FILTER html %]</td>
        <td>[% filter.field_description FILTER html %]</td>
        <td>[% filter.relationship ? filter.relationship_name : 'Any' FILTER html %]</td>
        <td>
          [% IF filter.changer %]
            <span title="[% filter.changer.name FILTER html %]">
              [% filter.changer.login FILTER html %]
            </span>
          [% ELSE %]
            Anyone
          [% END %]
        </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>

<hr>
<h4>Field Groups</h4>

<p>
  Some fields are grouped into a single entry in the "field" list.
  Following is a list of the groups and all the fields they contain:
</p>

[% FOREACH type = tracking_flags_by_type %]
  [% type.name FILTER html %]:
  <blockquote>
    [% flag_count = type.flags.size %]
    [% FOREACH flag = type.flags %]
      [% IF flag_count > 10 && loop.count == 10 %]
        <span id="show_all">
          &hellip;
          (<a href="#" onclick="showAllFlags(); return false">show all</a>)
        </span>
        <span id="all_flags" class="bz_default_hidden">
      [% END %]
      [% flag.description FILTER html FILTER no_break %]
      [% ", " UNLESS loop.last %]
      [% IF loop.last && flag_count > 10 %]
        </span>
      [% END %]
    [% END %]
  </blockquote>
[% END %]

<hr>
<h4>Examples</h4>
<p>
  To never receive changes made to the "QA Whiteboard" field for [% terms.bugs %]
  where you are not the assignee:<br>
</p>
<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>Changer:</th>
    <td>(empty)</td>
  </tr>
  <tr>
    <th>Action:</th>
    <td>Exclude</td>
  </tr>
</table>

<p>
  To never receive email for any change made by webops-kanban@mozilla.bugs:
</p>
<table class="example_filter_table">
  <tr>
    <th>Field:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Product:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Component:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Relationship:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Changer:</th>
    <td>webops-kanban@mozilla.bugs</td>
  </tr>
  <tr>
    <th>Action:</th>
    <td>Exclude</td>
  </tr>
</table>

<p>
  To receive notifications of new [% terms.bugs %] in Firefox's "New Tab Page"
  component, and no other changes, you require three filters.  First an
  <b>exclude</b> filter to drop all changes made to [% terms.bugs %] in that
  component:<br>
</p>
<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>New Tab Page</td>
  </tr>
  <tr>
    <th>Relationship:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Changer:</th>
    <td>(empty)</td>
  </tr>
  <tr>
    <th>Action:</th>
    <td>Exclude</td>
  </tr>
</table>
<p>
  Then an <b>include</b> filter to indicate that you want to receive
  notifications when a [% terms.bug %] is created:
</p>
<table class="example_filter_table">
  <tr>
    <th>Field:</th>
    <td>[% terms.Bug %] Created</td>
  </tr>
  <tr>
    <th>Product:</th>
    <td>Firefox</td>
  </tr>
  <tr>
    <th>Component:</th>
    <td>New Tab Page</td>
  </tr>
  <tr>
    <th>Relationship:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Changer:</th>
    <td>(empty)</td>
  </tr>
  <tr>
    <th>Action:</th>
    <td>Include</td>
  </tr>
</table>
<p>
  And finally another <b>include</b> filter to catch when a [% terms.bug %] is
  moved into the "New Tab Page" component.
</p>
<table class="example_filter_table">
  <tr>
    <th>Field:</th>
    <td>Component</td>
  </tr>
  <tr>
    <th>Product:</th>
    <td>Firefox</td>
  </tr>
  <tr>
    <th>Component:</th>
    <td>New Tab Page</td>
  </tr>
  <tr>
    <th>Relationship:</th>
    <td>__Any__</td>
  </tr>
  <tr>
    <th>Changer:</th>
    <td>(empty)</td>
  </tr>
  <tr>
    <th>Action:</th>
    <td>Include</td>
  </tr>
</table>