blob: 8c2432acc0a6c204a4105e986bc3c2f19e65a636 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
% layout 'mainlayout';
% my $mail_fmt = begin
% my ($category, $value) = @_;
<dt> <%= ucfirst l $category %> </dt>
<dd> <%= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value %> </dd>
% end
<div class=ow>
<h1>Read Mail</h1>
<dl id=show-head>
<dt> <%= uc l 'subject' %> </dt>
<dd> <%= $msg->{subject} %> </dd>
%= $mail_fmt->('from', $msg->{from});
%= $mail_fmt->('to', $msg->{to});
%= $mail_fmt->('cc', $msg->{cc}) if !ref $msg->{cc} || @{ $msg->{cc} };
%= $mail_fmt->('bcc', $msg->{bcc}) if !ref $msg->{bcc} || @{ $msg->{cc} };
<dt> <%= uc l 'date' %> </dt>
<dd> <%= $msg->{date_received} %> </dd>
<dt> <%= uc l 'size' %> </dt>
<dd> <%= print_sizes10 $msg->{size} %> </dd>
<dt> <%= uc l 'content-type' %> </dt>
<dd> <%= $msg->{content_type} %> </dd>
</dl>
% my $body = $msg->{body};
% if ($msg->{content_type} eq 'multipart/alternative') {
% for (reverse @$body) {
<div class=show-body>
% my $x = mime_render($_->{type}, $_->{val});
%== $x;
</div>
% last if $x;
% }
% }
% elsif (ref $body eq 'HASH') {
% for (%$body) {
<div class=show-body>
%== mime_render($_->{type}, $_->{val});
</div>
% }
% }
% else {
<div class=show-body>
%== mime_render($msg->{content_type}, $body);
</div>
% }
<nav id=read-nav>
<a href="javascript:history.back()" class=btn> <%= l 'home' %> </a>
</nav>
</div>
|