From 41a0a69ba25b46797b8fbc93a2035ed257b72999 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Thu, 16 Mar 2023 18:01:06 +0100 Subject: changed pagination appearance --- lib/JWebmail/Plugin/Paginate.pm | 9 +++++++++ lib/JWebmail/View/RenderMail.pm | 5 ++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/JWebmail') diff --git a/lib/JWebmail/Plugin/Paginate.pm b/lib/JWebmail/Plugin/Paginate.pm index 1a48ed3..9b39617 100644 --- a/lib/JWebmail/Plugin/Paginate.pm +++ b/lib/JWebmail/Plugin/Paginate.pm @@ -78,12 +78,21 @@ sub paginate { return $start, $end; } +sub make_link { + my ($c, $txt, $to) = @_; + + return $c->link_to( + $txt => $c->url_with->query({start => $c->stash('pgn')->{$to}[0]}), + class => ($c->param('start')//0) == $c->stash('pgn')->{$to}[0] ? 'disabled' : '', + ); +} sub register { my ($self, $app, $conf) = @_; $conf //= {}; $app->helper(paginate => \&paginate); + $app->helper('_paginate.make_link' => \&make_link); } diff --git a/lib/JWebmail/View/RenderMail.pm b/lib/JWebmail/View/RenderMail.pm index 07f356c..90534dc 100644 --- a/lib/JWebmail/View/RenderMail.pm +++ b/lib/JWebmail/View/RenderMail.pm @@ -12,10 +12,9 @@ has 'c'; sub render_text_plain { my ($_self, $_subtype, $content, $_path) = @_; - $content = xml_escape($content); - $content =~ s/\n/
/g; + $content = xml_escape $content; - return qq'
\n $content
\n'; + return qq'
$content
\n'; } sub render_text_html { -- cgit v1.2.3