summaryrefslogtreecommitdiff
path: root/templates/webmail/readmail.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/webmail/readmail.html.ep')
-rw-r--r--templates/webmail/readmail.html.ep43
1 files changed, 24 insertions, 19 deletions
diff --git a/templates/webmail/readmail.html.ep b/templates/webmail/readmail.html.ep
index 5bad9f3..b5b48a1 100644
--- a/templates/webmail/readmail.html.ep
+++ b/templates/webmail/readmail.html.ep
@@ -2,10 +2,14 @@
% my $mail_fmt = begin
% my ($category, $value) = @_;
- <dt> <%= ucfirst l $category %> </dt>
- <dd>
- %= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value
- </dd>
+ % if (ref $value eq 'ARRAY' && $value->@*) {
+ <dt> <%= uc l $category %> </dt>
+ % for ($value->@*) {
+ <dd>
+ %= $_->{name} ? qq("$_->{name}" <$_->{address}>) : "$_->{address}"
+ </dd>
+ % }
+ % }
% end
<div class="jwm-base">
@@ -16,42 +20,43 @@
<dt> <%= uc l 'subject' %> </dt>
<dd> <%= $msg->{head}{subject} %> </dd>
- %= $mail_fmt->('from', $msg->{head}{from})
- %= $mail_fmt->('to', $msg->{head}{to})
- %= $mail_fmt->('cc', $msg->{head}{cc}) if !ref $msg->{head}{cc} || @{ $msg->{head}{cc} }
- %= $mail_fmt->('bcc', $msg->{head}{bcc}) if !ref $msg->{head}{bcc} || @{ $msg->{head}{bcc} }
+ %= $mail_fmt->(from => $msg->{head}{from})
+ %= $mail_fmt->(to => $msg->{head}{to})
+ %= $mail_fmt->(cc => $msg->{head}{cc})
+ %= $mail_fmt->(bcc => $msg->{head}{bcc})
<dt> <%= uc l 'date' %> </dt>
<dd> <%= $msg->{head}{date} %> </dd>
- <dt> <%= uc l 'size' %> </dt>
- <dd> <%= print_sizes10 $msg->{size} %> </dd>
-
+ % my $content_type = $msg->{head}{mime}{content_maintype} . '/' . $msg->{head}{mime}{content_subtype};
<dt> <%= uc l 'content-type' %> </dt>
- <dd> <%= $msg->{head}{content_type} %> </dd>
+ <dd> <%= $content_type %> </dd>
</dl>
% my $body = $msg->{body};
-% if ($msg->{head}{content_type} eq 'multipart/alternative') {
-% for (reverse @$body) {
+% if ($content_type eq 'multipart/alternative') {
+% for (reverse @{$body->{parts}}) {
<div class=jwm-mail-body>
-% my $x = mime_render($_->{head}{content_type}, $_->{body});
+% my $x = mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
%== $x;
</div>
% last if $x;
% }
% }
-% elsif (ref $body eq 'HASH') {
-% for (%$body) {
+% elsif ($msg->{head}{mime}{content_maintype} eq 'multipart') {
+% for (@{$body->{parts}}) {
<div class=jwm-mail-body>
- %== mime_render($_->{head}{content_type}, $_->{body});
+ %== mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
</div>
% }
% }
+% elsif ($msg->{head}{mime}{content_maintype} eq 'message') {
+% die "not implemented"
+% }
% else {
<div class=jwm-mail-body>
- %== mime_render($msg->{head}{content_type}, $body);
+ %== mime_render($content_type, $body);
</div>
% }