From fd004da7fb20f885eeec229877f4892f4e72c73b Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Sat, 13 Oct 2012 14:38:55 +0200 Subject: Bug 245375: Scheduled whining needs custom columns r/a=LpSolit --- template/en/default/whine/mail.html.tmpl | 23 +++++++++-------------- template/en/default/whine/mail.txt.tmpl | 26 ++++++++++++++++---------- 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'template/en/default/whine') diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl index 3287dcc64..cfc3279c3 100644 --- a/template/en/default/whine/mail.html.tmpl +++ b/template/en/default/whine/mail.html.tmpl @@ -13,6 +13,7 @@ # bugs: array containing hashes of fieldnames->values for each bug # title: the title given in the whine scheduling mechanism # name: the name of the query + # columnlist: array of fieldnames to display in the mail # author: user object for the person who scheduled this whine # recipient: user object for the intended recipient of the message #%] @@ -47,26 +48,20 @@ - - - - - - - + [% FOREACH col = query.columnlist %] + [% NEXT IF col == 'bug_id' %] + + [% END %] [% FOREACH bug=query.bugs %] - - - - - - - + [% FOREACH col = query.columnlist %] + [% NEXT IF col == 'bug_id' %] + + [% END %] [% END %]
IDSevPriHWAssigneeStatusResolutionSummary[% field_descs.$col FILTER html %]
[% bug.bug_id %][% display_value("bug_severity", bug.bug_severity) FILTER html %][% display_value("priority", bug.priority) FILTER html %][% display_value("rep_platform", bug.rep_platform) FILTER html %][% bug.assigned_to FILTER html %][% display_value("bug_status", bug.bug_status) FILTER html %][% display_value("resolution", bug.resolution) FILTER html %][% bug.short_desc FILTER html %][% display_value(col, bug.$col) FILTER html %]
diff --git a/template/en/default/whine/mail.txt.tmpl b/template/en/default/whine/mail.txt.tmpl index 44ea655f2..ba1e95741 100644 --- a/template/en/default/whine/mail.txt.tmpl +++ b/template/en/default/whine/mail.txt.tmpl @@ -13,6 +13,7 @@ # bugs: array containing hashes of fieldnames->values for each bug # title: the title given in the whine scheduling mechanism # name: the name of the query + # columnlist: array of fieldnames to display in the mail # author: user object for the person who scheduled this whine # recipient: user object for the intended recipient of the message #%] @@ -35,16 +36,21 @@ [% FOREACH bug=query.bugs %] [% terms.Bug +%] [%+ bug.bug_id %]: [%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%] - Priority: [%+ display_value("priority", bug.priority) -%] - [% field_descs.bug_severity %]: [%+ display_value("bug_severity", bug.bug_severity) -%] - [%+ field.descs.rep_platform %]: [%+ display_value("rep_platform", bug.rep_platform) %] - Assignee: [%+ bug.assigned_to %] - Status: [%+ display_value("bug_status", bug.bug_status) %] - [%- IF bug.resolution -%] Resolution: [% display_value("resolution", bug.resolution) -%] - [%- END %] - Summary: [% bug.short_desc %] - - [% END %] + [% largest_title = 0 %] + [% FOREACH col = query.columnlist %] + [% NEXT IF col == 'bug_id' %] + [% IF field_descs.${col}.length > largest_title %] + [% largest_title = field_descs.${col}.length %] + [% END %] + [% END %] + [% FOREACH col = query.columnlist %] + [% NEXT IF col == 'bug_id' %] + [%+ " " FILTER repeat(largest_title - field_descs.${col}.length) %] + [% field_descs.$col %]: [% display_value($col, bug.$col) %] + [% END %] + + [% END %] + View as [% terms.bug %] list: [% urlbase %]buglist.cgi?cmdtype=runnamed&namedcmd=[% query.name FILTER uri %] [% END %] [% ELSE %] -- cgit v1.2.3-24-g4f1b