summaryrefslogtreecommitdiff
path: root/templates/webmail/readmail.html.ep
blob: 0a9fde07ccf5d265846ecca13ef70ad1e8cff232 (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->{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=show-body>
%       my $x = mime_render($_->{head}{content_type}, $_->{body});
%==     $x;
      </div>
%       last if $x;
%   }
% }
% elsif (ref $body eq 'HASH') {
%   for (%$body) {
      <div class=show-body>
%==     mime_render($_->{head}{content_type}, $_->{body});
      </div>
%   }
% }
% else {
    <div class=show-body>
%==   mime_render($msg->{head}{content_type}, $body);
    </div>
% }

<nav id=read-nav>
  <a href="javascript:history.back()" class=btn> <%= l 'home' %> </a>
</nav>

</div>