diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-10 13:54:57 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-10 13:54:57 +0100 |
commit | fcf5549584b69e62b6c2f0eb919f6799c7904211 (patch) | |
tree | e5f0e480af0f39f1c0f457ea0aca8d33f8fb4d0b /lib/JWebmail.pm | |
parent | df59f9dec32d7f8f08706fd3eb5b784deaa0abfc (diff) |
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
Diffstat (limited to 'lib/JWebmail.pm')
-rw-r--r-- | lib/JWebmail.pm | 16 |
1 files changed, 9 insertions, 7 deletions
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'); } |