Sfoglia il codice sorgente

fix display of quoted messages, add word wrapping to avoid 'disappearing links syndrome'

Michael van Elst 22 anni fa
parent
commit
cdbe3ffae7
2 ha cambiato i file con 29 aggiunte e 7 eliminazioni
  1. 28 6
      rt/rt.patch
  2. 1 1
      rt/rt.spec

+ 28 - 6
rt/rt.patch

@@ -18,8 +18,8 @@
          return ( 0, $self->loc('Could not create user') );
      }
 --- html/Ticket/Elements/ShowMessageStanza.dist	2003-08-05 16:21:42.000000000 +0200
-+++ html/Ticket/Elements/ShowMessageStanza	2003-08-05 16:28:06.000000000 +0200
-@@ -22,22 +22,23 @@
++++ html/Ticket/Elements/ShowMessageStanza	2003-08-06 11:49:29.000000000 +0200
+@@ -22,23 +22,44 @@
  %# 
  %# END LICENSE BLOCK
  <%perl>
@@ -29,9 +29,15 @@
 -                  Depth   => $Depth + 1,
 -                  Transaction => $Transaction,
 -                  Message => $stanza );
-+  { my $msg = '';
++  { my $msg='';
 +    foreach my $stanza (@$Message) {
 +        if ( ref $stanza eq "ARRAY" ) {
++            if ($msg ne '') {
++</%perl>
++<font color="<%$colors[$Depth]%>"><pre><%$msg |n%></pre></font>
++<%perl>
++                $msg = '';
++            }
 +            $m->comp( 'ShowMessageStanza',
 +                      Depth   => $Depth + 1,
 +                      Transaction => $Transaction,
@@ -41,8 +47,20 @@
 +            my $content = $stanza->{raw};
 +            RT::Interface::Web::EscapeUTF8(\$content);
 +            $m->comp('/Elements/Callback', content => \$content, %ARGS);
++            my $max = 0;
++            foreach ( split ( /\n/, $content ) ) {
++                $max = length if length > $max;
++            }   
++            if ( $max > 76 ) {                      
++                require Text::Wrapper;
++                my $wrapper = new Text::Wrapper(
++                    columns    => 70,
++                    body_start => ( $max > 70 * 3 ? '   ' : '' ),
++                    par_start  => '');
++                $content = $wrapper->wrap($content);
++            }
 +            $msg .= "$content\n";
-+           }
++        }
      }
 -    elsif ( ref $stanza eq "HASH" ) {
 -        my $content = $stanza->{raw};
@@ -53,10 +71,14 @@
  </%perl>
 -<font color="<%$colors[$Depth]%>"><%$content |n%><br></font>
 -%       }
-+<font color="<%$colors[$Depth]%>"><pre><%$msg |n%></pre><br></font>
- % }
+-% }
++<font color="<%$colors[$Depth]%>"><pre><%$msg |n%></pre></font>
++<%perl>
++  }
++</%perl>
  <%INIT>
  use URI::URL;
+ my $server = 'fsck.com';
 --- html/Elements/Header.dist	2003-08-05 16:22:02.000000000 +0200
 +++ html/Elements/Header	2003-08-05 16:24:22.000000000 +0200
 @@ -40,9 +40,10 @@

+ 1 - 1
rt/rt.spec

@@ -49,7 +49,7 @@ Distribution: OpenPKG [EVAL]
 Group:        Database
 License:      GPL
 Version:      %{V_here}
-Release:      20030805
+Release:      20030806
 
 #   package options
 %option       with_color_primary   336699