summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/process/bugmail.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/bug/process/bugmail.html.tmpl')
-rw-r--r--template/en/default/bug/process/bugmail.html.tmpl58
1 files changed, 40 insertions, 18 deletions
diff --git a/template/en/default/bug/process/bugmail.html.tmpl b/template/en/default/bug/process/bugmail.html.tmpl
index b0132a2fe..21e4ff7b7 100644
--- a/template/en/default/bug/process/bugmail.html.tmpl
+++ b/template/en/default/bug/process/bugmail.html.tmpl
@@ -24,37 +24,59 @@
# sent_bugmail: The results of Bugzilla::BugMail::Send().
#%]
+[% USE CGI %]
[% PROCESS global/variables.none.tmpl %]
-<dl>
-[% PROCESS emails
- description = "Email sent to"
- names = sent_bugmail.sent
+[%# hide the recipient list by default from new users %]
+[% show_recipients =
+ user.settings.post_bug_submit_action.value == 'nothing'
+ || CGI.cookie('show_bugmail_recipients')
+ || !user.can_see_bug(mailing_bugid)
%]
+[% recipient_count = sent_bugmail.sent.size %]
-[% PROCESS emails
- description = "Excluding"
- names = sent_bugmail.excluded
-%]
-</dl>
+<script>
+function toggleBugmailRecipients(bug_id, show) {
+ if (show) {
+ YAHOO.util.Dom.removeClass('bugmail_summary_' + bug_id, 'bz_default_hidden');
+ YAHOO.util.Dom.addClass('bugmail_summary_' + bug_id + '_short', 'bz_default_hidden');
+ } else {
+ YAHOO.util.Dom.addClass('bugmail_summary_' + bug_id, 'bz_default_hidden');
+ YAHOO.util.Dom.removeClass('bugmail_summary_' + bug_id + '_short', 'bz_default_hidden');
+ }
+ YAHOO.util.Cookie.set('show_bugmail_recipients', (show ? 1 : 0), {
+ expires: new Date("January 12, 2025")
+ });
+ return false;
+}
+</script>
-[%############################################################################%]
-[%# Block for a set of email addresses #%]
-[%############################################################################%]
-
-[% BLOCK emails %]
- <dt>[% description FILTER html %]:</dt>
+<dl id="bugmail_summary_[% mailing_bugid FILTER none %]"
+ class="[% show_recipients ? "" : "bz_default_hidden" %]">
+ <dt>Email sent to:</dt>
<dd>
[% IF user.can_see_bug(mailing_bugid) %]
- [% IF names.size > 0 %]
- [%+ FOREACH name = names %]
+ [% IF sent_bugmail.sent.size > 0 %]
+ [%+ FOREACH name = sent_bugmail.sent %]
<code>[% name FILTER html %]</code>[% ", " UNLESS loop.last() %]
[% END %]
[% ELSE %]
no one
[% END %]
+ (<a href="#" onclick="return toggleBugmailRecipients([% mailing_bugid FILTER none %], false)">hide</a>)
[% ELSE %]
(list of e-mails not available)
[% END %]
</dd>
-[% END %]
+</dl>
+
+<div id="bugmail_summary_[% mailing_bugid FILTER none %]_short"
+ class="[% show_recipients ? "bz_default_hidden" : "" %]">
+ [% IF recipient_count > 0 %]
+ Email sent to [% recipient_count FILTER html %] recipient[% 's' UNLESS recipient_count == 1 %].
+ (<a href="#" onclick="return toggleBugmailRecipients([% mailing_bugid FILTER none %], true)">show</a>)
+ [% ELSE %]
+ No emails were sent.
+ [% END %]
+</div>
+