From fcf5549584b69e62b6c2f0eb919f6799c7904211 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Fri, 10 Mar 2023 13:54:57 +0100 Subject: Proper recursive rendering of mails to html 1. Added raw mode to model 2. Added raw route 3. Moved readmail view parts to RenderMail plugin 4. Renamed displayheaders partial templates --- lib/JWebmail.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/JWebmail.pm') diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 3abc78d..6963d44 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -44,6 +44,7 @@ sub startup { $self->plugin('ServerSideSessionData'); } $self->plugin('Helper'); + $self->plugin('RenderMail'); my $i18n_route = $self->plugin('I18N2', $self->config('i18n')); $self->secrets( [$self->config('secret')] ) if $self->config('secret'); @@ -85,17 +86,18 @@ sub route { my $r = shift || $self->routes; - $r->get('/' => 'login')->to('Webmail#noaction'); + $r->get( '/' => 'login')->to('Webmail#noaction'); $r->post('/' => 'login')->to('Webmail#login'); - $r->get('/about')->to('Webmail#about'); - $r->get('/logout')->to('Webmail#logout'); + $r->get('/about' )->to('Webmail#about'); + $r->get('/logout' )->to('Webmail#logout'); my $a = $r->under('/')->to('Webmail#auth'); - $a->get('/home/*folder')->to('Webmail#displayheaders', folder => '')->name('displayheaders'); + $a->get('/home/*folder' )->to('Webmail#displayheaders', folder => '')->name('displayheaders'); $a->get('/read/#id' => 'read')->to('Webmail#readmail'); - $a->get('/write')->to('Webmail#writemail'); - $a->post('/write' => 'send')->to('Webmail#sendmail'); - $a->post('/move')->to('Webmail#move'); + $a->get('/raw/#id' => 'raw' )->to('Webmail#raw'); + $a->get('/write' )->to('Webmail#writemail'); + $a->post('/write' => 'send' )->to('Webmail#sendmail'); + $a->post('/move' )->to('Webmail#move'); } -- cgit v1.2.3