blob: 5bad9f31c625874b770a7a6a8063d7ee20c81388 (
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
57
58
59
60
61
62
63
64
|
% 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="jwm-base">
<h1>Read Mail</h1>
<dl class="jwm-mail-header">
<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} }
<dt> <%= uc l 'date' %> </dt>
<dd> <%= $msg->{head}{date} %> </dd>
<dt> <%= uc l 'size' %> </dt>
<dd> <%= print_sizes10 $msg->{size} %> </dd>
<dt> <%= uc l 'content-type' %> </dt>
<dd> <%= $msg->{head}{content_type} %> </dd>
</dl>
% my $body = $msg->{body};
% if ($msg->{head}{content_type} eq 'multipart/alternative') {
% for (reverse @$body) {
<div class=jwm-mail-body>
% my $x = mime_render($_->{head}{content_type}, $_->{body});
%== $x;
</div>
% last if $x;
% }
% }
% elsif (ref $body eq 'HASH') {
% for (%$body) {
<div class=jwm-mail-body>
%== mime_render($_->{head}{content_type}, $_->{body});
</div>
% }
% }
% else {
<div class=jwm-mail-body>
%== mime_render($msg->{head}{content_type}, $body);
</div>
% }
<nav>
<a href="javascript:history.back()" class="pure-button">
%= l 'back'
</a>
</nav>
</div>
|