summaryrefslogtreecommitdiffstats
path: root/template/en/default/account
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/account')
-rw-r--r--template/en/default/account/prefs/email.html.tmpl55
1 files changed, 23 insertions, 32 deletions
diff --git a/template/en/default/account/prefs/email.html.tmpl b/template/en/default/account/prefs/email.html.tmpl
index a4d22db73..4b76f734d 100644
--- a/template/en/default/account/prefs/email.html.tmpl
+++ b/template/en/default/account/prefs/email.html.tmpl
@@ -35,9 +35,6 @@
[% PROCESS global/variables.none.tmpl %]
-[% useqacontact = Param('useqacontact') %]
-[% usevotes = Param('usevotes') %]
-
<p>
If you don't like getting a notification for "trivial"
changes to [% terms.bugs %], you can use the settings below to
@@ -150,21 +147,28 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
[% relationships = [
{ id = constants.REL_ASSIGNEE,
description = "Assignee" },
- { id = constants.REL_QA,
- description = "QA Contact" },
{ id = constants.REL_REPORTER,
description = "Reporter" },
{ id = constants.REL_CC,
description = "CCed" },
- { id = constants.REL_VOTER,
- description = "Voter" },
] %]
+[% IF Param('useqacontact') %]
+ [% relationships.push({ id = constants.REL_QA,
+ description = "QA Contact" }) %]
+[% END %]
+
+
+[%# This is up here so that the "relationships" hook can modify it. %]
+[% no_added_removed = [constants.REL_REPORTER] %]
+
+[% Hook.process('relationships') %]
+
+[% num_columns = relationships.size %]
+
<table class="bz_emailprefs" border="1">
<tr>
- <td colspan="[% (useqacontact AND usevotes) ? '5' :
- ((useqacontact OR usevotes) ? '4' : '3') %]"
- align="center" width="50%">
+ <td colspan="[% num_columns FILTER html %]" align="center" width="50%">
<b>When my relationship to this [% terms.bug %] is:</b>
</td>
<td rowspan="2" width="40%">
@@ -174,8 +178,6 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
<tr>
[% FOREACH relationship = relationships %]
- [% NEXT IF (relationship.id == constants.REL_QA AND NOT useqacontact) OR
- (relationship.id == constants.REL_VOTER AND NOT usevotes) %]
<th align="center" width="9%">
[% relationship.description FILTER html %]
</th>
@@ -186,16 +188,14 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
[% count = loop.count() %]
<tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
[% FOREACH relationship = relationships %]
- [% NEXT IF (relationship.id == constants.REL_QA AND NOT useqacontact) OR
- (relationship.id == constants.REL_VOTER AND NOT usevotes) %]
<td align="center">
<input type="checkbox"
name="email-[% relationship.id %]-[% event.id %]"
value="1"
[%# The combinations don't always make sense; disable a couple %]
[% IF event.id == constants.EVT_ADDED_REMOVED AND
- (relationship.id == constants.REL_REPORTER OR
- relationship.id == constants.REL_VOTER) %]
+ no_added_removed.contains(relationship.id)
+ %]
disabled
[% ELSIF mail.${relationship.id}.${event.id} %]
checked
@@ -209,8 +209,7 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
[% END %]
<tr>
- <td colspan="[% (useqacontact AND usevotes) ? '5' :
- ((useqacontact OR usevotes) ? '4' : '3') %]"
+ <td colspan="[% num_columns FILTER html %]"
align="center" width="50%">
&nbsp;
</td>
@@ -223,8 +222,6 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
[% count = loop.count() %]
<tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
[% FOREACH relationship = relationships %]
- [% NEXT IF (relationship.id == constants.REL_QA AND NOT useqacontact) OR
- (relationship.id == constants.REL_VOTER AND NOT usevotes) %]
<td align="center">
<input type="checkbox"
name="neg-email-[% relationship.id %]-[% event.id %]"
@@ -243,23 +240,17 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
[%# Add hidden form fields for fields not used %]
[% FOREACH event = events %]
[% FOREACH relationship = relationships %]
- [% IF (relationship.id == constants.REL_QA AND NOT useqacontact) OR
- (relationship.id == constants.REL_VOTER AND NOT usevotes) %]
- <input type="hidden"
- name="email-[% relationship.id %]-[% event.id %]"
- value="[% mail.${relationship.id}.${event.id} ? "1" : "0" %]">
- [% END %]
+ <input type="hidden"
+ name="email-[% relationship.id %]-[% event.id %]"
+ value="[% mail.${relationship.id}.${event.id} ? "1" : "0" %]">
[% END %]
[% END %]
[% FOREACH event = neg_events %]
[% FOREACH relationship = relationships %]
- [% IF (relationship.id == constants.REL_QA AND NOT useqacontact) OR
- (relationship.id == constants.REL_VOTER AND NOT usevotes) %]
- <input type="hidden"
- name="neg-email-[% relationship.id %]-[% event.id %]"
- value="[% mail.${relationship.id}.${event.id} ? "0" : "1" %]">
- [% END %]
+ <input type="hidden"
+ name="neg-email-[% relationship.id %]-[% event.id %]"
+ value="[% mail.${relationship.id}.${event.id} ? "0" : "1" %]">
[% END %]
[% END %]