From 6638a015487885a47bb0ba851865ef8b073d08fb Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Thu, 19 Mar 2015 15:16:30 +0800 Subject: Bug 1105568: Add support for HTML flagmail r=glob,a=glob --- template/en/default/email/flagmail-header.txt.tmpl | 28 ++++++++ template/en/default/email/flagmail.html.tmpl | 80 ++++++++++++++++++++++ template/en/default/email/flagmail.txt.tmpl | 11 --- 3 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 template/en/default/email/flagmail-header.txt.tmpl create mode 100644 template/en/default/email/flagmail.html.tmpl (limited to 'template/en/default/email') diff --git a/template/en/default/email/flagmail-header.txt.tmpl b/template/en/default/email/flagmail-header.txt.tmpl new file mode 100644 index 000000000..8aa3955f7 --- /dev/null +++ b/template/en/default/email/flagmail-header.txt.tmpl @@ -0,0 +1,28 @@ +[%# 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. + #%] + +[% flagtype_name = flag ? flag.type.name : old_flag.type.name %] +[% statuses = { '+' => "granted" , '-' => 'denied' , 'X' => "canceled" , + '?' => "asked" } %] + +[% action = flag.status || 'X' %] + +[% IF flag && flag.status == '?' %] + [% subject_status = "requested" %] +[% ELSE %] + [% subject_status = statuses.$action %] +[% END %] +From: [% Param('mailfrom') %] +To: [% to %] +Subject: [% flagtype_name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] +[%- IF attachment %] : + [Attachment [% attachment.id %]] [% attachment.description FILTER clean_text %][% END %] +Date: [% date %] +X-Bugzilla-Type: request +[%+ INCLUDE "email/header-common.txt.tmpl" %] +[%+ threadingmarker %] diff --git a/template/en/default/email/flagmail.html.tmpl b/template/en/default/email/flagmail.html.tmpl new file mode 100644 index 000000000..314455c65 --- /dev/null +++ b/template/en/default/email/flagmail.html.tmpl @@ -0,0 +1,80 @@ +[%# 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. + #%] + +[% flagtype_name = flag ? flag.type.name : old_flag.type.name %] +[% statuses = { '+' => "granted" , '-' => 'denied' , 'X' => "canceled" , + '?' => "asked" } %] + +[% action = flag.status || 'X' %] + +[% pending_request = (flag && flag.status == '?') %] +[% reassigned = (pending_request && flag.setter_id != user.id) %] +[% was_pending_request = (old_flag && old_flag.status == '?') %] + + + + + + +

+ [% INCLUDE global/user.html.tmpl user = to_user, who = user %] has + [% IF reassigned =%] + reassigned [% INCLUDE global/user.html.tmpl user = to_user, who = flag.setter %]'s request for + [% IF old_flag.requestee.defined %] + [%= INCLUDE global/user.html.tmpl user = to_user, who = old_flag.requestee %]'s + [% END %] + [%= flagtype_name FILTER html %] + [% IF flag.requestee.defined =%] + to [% INCLUDE global/user.html.tmpl user = to_user, who = flag.requestee %] + [% END %] + [% ELSE %] + [%= statuses.$action FILTER html %] + [% IF pending_request %] + [%= INCLUDE global/user.html.tmpl user = to_user, who = flag.requestee %] for + [% ELSIF was_pending_request %] + [%= INCLUDE global/user.html.tmpl user = to_user, who = old_flag.setter %]'s request for + [% IF old_flag.requestee.defined %] + [%= INCLUDE global/user.html.tmpl user = to_user, who = old_flag.requestee %]'s + [% END %] + [% END %] + [% flagtype_name FILTER html %] + [% END %]: +

+ +

+ [% "$terms.Bug $bug.bug_id" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %]: + [%= bug.short_desc FILTER html %] +

+ + [% IF attachment %] +

+ Attachment [% attachment.id FILTER html %]: + [%= attachment.description FILTER html %] +

+ [% END %] + + [% Hook.process('after_summary') %] + +

+ [% FOREACH comment = new_comments %] +

+ [% IF comment.count %] + [% "Comment # ${comment.count}" FILTER bug_link(bug, + {comment_num => comment.count, full_url => 1, user => to_user}) FILTER none =%] + on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none =%] + from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %] + [% ELSE %] + Description: + [% END %] +
[% comment.body_full({ wrap => 1 }) FILTER markdown(bug, comment, to_user) %]
+
+ [% END %] +

+ + diff --git a/template/en/default/email/flagmail.txt.tmpl b/template/en/default/email/flagmail.txt.tmpl index cf64d9661..9b80a493d 100644 --- a/template/en/default/email/flagmail.txt.tmpl +++ b/template/en/default/email/flagmail.txt.tmpl @@ -17,7 +17,6 @@ [% action = flag.status || 'X' %] [% IF flag && flag.status == '?' %] - [% subject_status = "requested" %] [% IF flag.setter_id == user.id %] [% to_identity = flag.requestee.identity _ " for" %] [% ELSE %] @@ -31,17 +30,7 @@ [% requestee_identity = old_flag.requestee.identity _ "'s" %] [% END %] [% END %] - [% subject_status = statuses.$action %] [% END %] -From: [% Param('mailfrom') %] -To: [% to %] -Subject: [% flagtype_name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] -[%- IF attachment %] : - [Attachment [% attachment.id %]] [% attachment.description FILTER clean_text %][% END %] -Date: [% date %] -X-Bugzilla-Type: request -[%+ INCLUDE "email/header-common.txt.tmpl" %] -[%+ threadingmarker %] [%+ USE wrap -%] [%- FILTER bullet = wrap(80) -%] -- cgit v1.2.3-24-g4f1b