From 82c721450888328c7183bc2e4c4e39934194b949 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 20 Jan 2009 20:22:07 +0000 Subject: Bug 470057: Collapse and wrap text messages and text errors Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/Template.pm | 4 ++++ template/en/default/admin/sanitycheck/messages.html.tmpl | 9 +++++++-- template/en/default/email/sanitycheck.txt.tmpl | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 3141c8a4c..e5fecbe0d 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -698,6 +698,10 @@ sub create { $var =~ s/\>/>/g; $var =~ s/\"/\"/g; $var =~ s/\&/\&/g; + # Now remove extra whitespace, and wrap it to 72 characters. + my $collapse_filter = $Template::Filters::FILTERS->{collapse}; + $var = $collapse_filter->($var); + $var = wrap_comment($var, 72); return $var; }, diff --git a/template/en/default/admin/sanitycheck/messages.html.tmpl b/template/en/default/admin/sanitycheck/messages.html.tmpl index 2847a35e7..b65f8eac5 100644 --- a/template/en/default/admin/sanitycheck/messages.html.tmpl +++ b/template/en/default/admin/sanitycheck/messages.html.tmpl @@ -310,8 +310,13 @@ [% END %] [% END %] -[% san_message FILTER html %] - +[% USE Bugzilla %] +[% IF Bugzilla.usage_mode == constants.USAGE_MODE_CMDLINE %] + [% san_message FILTER none %] +[% ELSE %] + [%# Avoid the txt filter in message.txt.tmpl. %] + [% san_message FILTER html %] +[% END %] [% BLOCK bug_list %] [% FOREACH bug_id = badbugs %] diff --git a/template/en/default/email/sanitycheck.txt.tmpl b/template/en/default/email/sanitycheck.txt.tmpl index 9c1926925..8826d4e39 100644 --- a/template/en/default/email/sanitycheck.txt.tmpl +++ b/template/en/default/email/sanitycheck.txt.tmpl @@ -33,4 +33,4 @@ Some errors have been found. No errors have been found. [% END %] -[% output FILTER txt %] +[% output %] -- cgit v1.2.3-24-g4f1b