]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 470057: Collapse and wrap text messages and text errors
authormkanat%bugzilla.org <>
Tue, 20 Jan 2009 20:22:07 +0000 (20:22 +0000)
committermkanat%bugzilla.org <>
Tue, 20 Jan 2009 20:22:07 +0000 (20:22 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla/Template.pm
template/en/default/admin/sanitycheck/messages.html.tmpl
template/en/default/email/sanitycheck.txt.tmpl

index 3141c8a4cded1c5697c82f7a59124b8b26550fc6..e5fecbe0d89a08d7ebc44161e83a4f12d2097640 100644 (file)
@@ -698,6 +698,10 @@ sub create {
                 $var =~ s/\&gt;/>/g;
                 $var =~ s/\&quot;/\"/g;
                 $var =~ s/\&amp;/\&/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;
             },
 
index 2847a35e761ffe137c43cfa0aaffaf27aac2e8f8..b65f8eac545322d9fc098be5969fc42b2546fcd7 100644 (file)
   [% 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 %]
index 9c19269257181d61d0d32e91c156b2f0f4b627da..8826d4e3955a5c0f4bb350fcfd52ab6e87c1d61b 100644 (file)
@@ -33,4 +33,4 @@ Some errors have been found.
 No errors have been found.
 [% END %]
 
-[% output FILTER txt %]
+[% output %]