From 2f3b5dd7df3e131af6aef3cd5ccf7e8523c1780e Mon Sep 17 00:00:00 2001
From: Byron Jones
Date: Tue, 8 Jul 2014 16:40:14 +0800
Subject: Bug 990980: create an extension for server-side filtering of bugmail
---
.../default/account/prefs/bugmail_filter.html.tmpl | 256 +++++++++++++++++++++
.../hook/account/prefs/prefs-tabs.html.tmpl | 14 ++
.../hook/global/user-error-errors.html.tmpl | 13 ++
3 files changed, 283 insertions(+)
create mode 100644 extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl
create mode 100644 extensions/BugmailFilter/template/en/default/hook/account/prefs/prefs-tabs.html.tmpl
create mode 100644 extensions/BugmailFilter/template/en/default/hook/global/user-error-errors.html.tmpl
(limited to 'extensions/BugmailFilter/template')
diff --git a/extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl b/extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl
new file mode 100644
index 000000000..d2df77d22
--- /dev/null
+++ b/extensions/BugmailFilter/template/en/default/account/prefs/bugmail_filter.html.tmpl
@@ -0,0 +1,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.
+ #%]
+
+
+
+
+[% SET selectable_products = user.get_selectable_products %]
+[% SET dont_show_button = 1 %]
+
+
+
+
+
+Bugmail Filtering
+
+
+ You can instruct [% terms.Bugzilla %] to filter bugmail based on the field
+ that was changed.
+
+
+
+
+
Field:
+
+
+
+
+ the field that was changed
+
+
+
+
Product:
+
+
+
+
+ the [% terms.bug %]'s current product
+
+
+
+
Component:
+
+
+
+
+ the [% terms.bug %]'s current component
+
+
+
+
Relationship:
+
+
+
+
+ your relationship with the [% terms.bug %]
+
+
+
+
Action:
+
+
+
+
+ action to take when all conditions match
+
+
+
+
+
+
+
+
+
+
+ You are currently filtering on:
+
+
+[% IF filters.size %]
+
+
+
+
+
Product
+
Component
+
Field
+
Relationship
+
Action
+
+ [% FOREACH filter = filters %]
+
+
+
+
+
[% filter.product ? filter.product.name : 'Any' FILTER html %]
+
[% filter.component ? filter.component.name : 'Any' FILTER html %]
+
[% filter.field ? filter.field.description : 'Any' FILTER html %]
+
[% filter.relationship ? filter.relationship_name : 'Any' FILTER html %]
+
[% filter.action ? 'Exclude' : 'Include' %]
+
+ [% END %]
+
+
+
+
+
+
+[% ELSE %]
+
+
+ You do not have any filters configured.
+
+
+[% END %]
+
+
+
+ This feature provides fine-grained control over what changes to [% terms.bugs
+ %] will result in an email notification. These filters are applied
+ after the rules configured on the
+ Email Preferences tab.
+
+
+ If multiple filters are applicable to the same [% terms.bug %] change,
+ include filters override exclude filters.
+
+
+ Examples:
+
+
+ To never receive changes made to the "QA Whiteboard" field for [% terms.bugs %]
+ where you are not the assignee:
+
+
+
Field:
+
QA Whiteboard
+
+
+
Product:
+
__Any__
+
+
+
Component:
+
__Any__
+
+
+
Relationship:
+
Not Assignee
+
+
+
Action:
+
Exclude
+
+
+
+
+ To receive just comments made to Firefox [% terms.bugs %], and no other
+ changes, you require two filters. First an exclude filter to drop all
+ changes made to [% terms.bugs %] in that product:
+
+
+
Field:
+
__Any__
+
+
+
Product:
+
Firefox
+
+
+
Component:
+
__Any__
+
+
+
Relationship:
+
__Any__
+
+
+
Action:
+
Exclude
+
+
+
+ Then an include filter to indicate that you want to receive
+ comments:
+
+
+
Field:
+
Comment Created
+
+
+
Product:
+
Firefox
+
+
+
Component:
+
__Any__
+
+
+
Relationship:
+
__Any__
+
+
+
Action:
+
Include
+
+
+
diff --git a/extensions/BugmailFilter/template/en/default/hook/account/prefs/prefs-tabs.html.tmpl b/extensions/BugmailFilter/template/en/default/hook/account/prefs/prefs-tabs.html.tmpl
new file mode 100644
index 000000000..95ffdee99
--- /dev/null
+++ b/extensions/BugmailFilter/template/en/default/hook/account/prefs/prefs-tabs.html.tmpl
@@ -0,0 +1,14 @@
+[%# 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.
+ #%]
+
+[% tabs = tabs.import([{
+ name => "bugmail_filter",
+ label => "Bugmail Filtering",
+ link => "userprefs.cgi?tab=bugmail_filter",
+ saveable => 1
+ }]) %]
diff --git a/extensions/BugmailFilter/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/BugmailFilter/template/en/default/hook/global/user-error-errors.html.tmpl
new file mode 100644
index 000000000..380c07ee5
--- /dev/null
+++ b/extensions/BugmailFilter/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -0,0 +1,13 @@
+[%# 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 error == "bugmail_filter_exists" %]
+ [% title = "Filter Already Exists" %]
+ A filter already exists with the selected criteria.
+
+[% END %]
--
cgit v1.2.3-24-g4f1b