[Rt-commit] rt branch, 3.8-plain-text-mono, updated. 084a6d3a87c06e9ec75ff642ac15568cacd41f73
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Aug 18 02:57:22 EDT 2009
The branch, 3.8-plain-text-mono has been updated
via 084a6d3a87c06e9ec75ff642ac15568cacd41f73 (commit)
from fc668bfe85dbf11f6bcf28f8803ce80cd34ea3ff (commit)
Summary of changes:
etc/RT_Config.pm.in | 11 ++++++++++-
lib/RT/Config.pm | 13 +++++++++++--
share/html/NoAuth/css/web2/ticket.css | 4 ++++
.../Ticket/Elements/ShowTransactionAttachments | 2 +-
4 files changed, 26 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 084a6d3a87c06e9ec75ff642ac15568cacd41f73
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Aug 18 14:56:53 2009 +0800
add PlainTextMono option
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 4943769..1bfd0dc 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1125,12 +1125,21 @@ Normally plaintext attachments are displayed as HTML with line
breaks preserved. This causes space- and tab-based formatting not
to be displayed correctly. By setting $PlainTextPre they'll be
displayed using <pre> instead so such formatting works, but they'll
-use a monospaced font.
+use a monospaced font, no matter what the value of C<$PlainTextMono> is.
=cut
Set($PlainTextPre, 0);
+=item C<$PlainTextMono>
+
+To display plaintext attachments,
+Set C<$PlainTextMono> to 1 to use monospaced font, 0 to not to.
+
+=cut
+
+Set($PlainTextMono, 0);
+
=item C<$ShowUnreadMessageNotifications>
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 5b82326..9bd118c 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -299,8 +299,17 @@ our %META = (
SortOrder => 4,
Widget => '/Widgets/Form/Boolean',
WidgetArguments => {
- Description => 'Use monospace font', #loc
- Hints => "Use fixed-width font to display plaintext messages" #loc
+ Description => 'add <pre> tag around plain text attachments', #loc
+ Hints => "Use this to protect the format of plain text" #loc
+ },
+ },
+ PlainTextMono => {
+ Section => 'Ticket display',
+ Overridable => 1,
+ SortOrder => 5,
+ Widget => '/Widgets/Form/Boolean',
+ WidgetArguments => {
+ Description => 'Use monospaced font to display plain text attachments', #loc
},
},
diff --git a/share/html/NoAuth/css/web2/ticket.css b/share/html/NoAuth/css/web2/ticket.css
index ebc08cd..f47c3ec 100644
--- a/share/html/NoAuth/css/web2/ticket.css
+++ b/share/html/NoAuth/css/web2/ticket.css
@@ -118,6 +118,10 @@ div#ticket-history div.content {
margin-left: 1.5em;
}
+div.mono {
+ font-family: monospace;
+}
+
.ticket-transaction .messagebody {
font-size: 1em;
padding-left: 1em;
diff --git a/share/html/Ticket/Elements/ShowTransactionAttachments b/share/html/Ticket/Elements/ShowTransactionAttachments
index 38820ab..fe77b08 100644
--- a/share/html/Ticket/Elements/ShowTransactionAttachments
+++ b/share/html/Ticket/Elements/ShowTransactionAttachments
@@ -76,7 +76,7 @@ foreach my $message ( grep $_->__Value('Parent') == $Parent, @$Attachments ) {
% if ( scalar ( grep $_->__Value('Parent') == $message->id, @$Attachments ) ) {
<div class="messageattachments">
% } else {
-<div class="messagebody">
+<div class="messagebody<% RT->Config->Get('PlainTextMono', $session{'CurrentUser'}) ? ' mono' : ''%>">
% }
<%PERL>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list