From 5a131611da2a04ced518adca06cfce23ac27e43f Mon Sep 17 00:00:00 2001 From: Christian Veigl Date: Wed, 12 Sep 2012 13:34:59 +0000 Subject: [PATCH] truncate long patterns and suffix with "..." (mantis:1853) --- root/tt/rewrite_detail.tt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/root/tt/rewrite_detail.tt b/root/tt/rewrite_detail.tt index c46edd6..d763d6b 100644 --- a/root/tt/rewrite_detail.tt +++ b/root/tt/rewrite_detail.tt @@ -26,6 +26,7 @@

Rewrite Rule Set [% set.rewrite_set.name %]

Back

+

Very long entries are truncated and suffixed with "...". Hoover over them to see the full entry.

[% rewrites = [ @@ -125,9 +126,10 @@ Cancel [% ELSE %] -
[% rule.match_pattern %]
-
[% rule.replace_pattern %]
-
[% rule.description %]
+
[% PROCESS shorten string = rule.match_pattern %]
+
[% PROCESS shorten string = rule.replace_pattern %]
+
[% PROCESS shorten string = rule.description %]
+
[% UNLESS Catalyst.session.admin.read_only %] Edit @@ -182,3 +184,11 @@ [% END %] +[% BLOCK shorten %] + [% IF string.length > 20 %] + [% string.substr(0, 20) _ '...' %] + [% ELSE %] + [% string %] + [% END %] +[% END %] +