summaryrefslogtreecommitdiff
path: root/templates/headers/_display_headers.html.ep
blob: da04873b976a9dd01a25b38e33df3990bc7eb8fb (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% my $sort_param = begin
  % my $param = shift;

  <th class=sort-param>
    <a href="<%= url_with->query(sort => (param('sort') || '') eq $param ? '!' . $param : $param) %>">
      % no warnings qw(experimental::smartmatch);
      %= do { given (param('sort')) { '↑' when ($param); '↓' when ('!' . $param) } }
      %= ucfirst l $param;
    </a>
  </th>

% end

<table id=mail-headers>

  <colgroup>
    <col width=5% />
    <col width=10% />
    <col width=15% />
    <col width=25% />
    <col width=25% />
    <col width=10% />
    <col width=10% />
  </colgroup>

  <thead>
    <tr id=sort>
      <th> <%= ucfirst l 'nr' %> </th>

      %= $sort_param->('status');

      %= $sort_param->('date');


    % if ($folder ne "SENT") {
      %= $sort_param->('sender');
    % } else {
      <th class=sort-param>
        <a href="<%= url_with->query(sort => param('sort') ne '!sender' ? 'sender' : '!sender' ) %>">
        <%= ucfirst l 'recipient' %>
        % if (param('sort') eq "sender") {
            <IMG SRC="/down.gif" width="12" height="12" border="0" alt="v">
        % } elsif (param('sort') eq "recipient_rev") {
            <IMG SRC="/up.gif" width="12" height="12" border="0" alt="^">
        % }
        </a>
      </th>
    % }

      %= $sort_param->('subject');

      %= $sort_param->('size');

      <th>
        <!-- <img src="/chkb.gif"> -->
        <input type=checkbox checked=1 disabled=1>
      </th>
    </tr>
  </thead>


  <tbody>
  % foreach my $msgnum ($first_item .. $last_item) {
  %   my $msg = $msgs->[$msgnum - $first_item];

    <tr class="<%= $msg->{new} ? 'new-mail' : '' %>" id="<%= $msg->{mid} %>" >
      <td>
        %= $msgnum
      </td>
      <td>
        %= ucfirst($msg->{is_multipart} ? l('yes') : l('no'));
      </td>
      <td>
        % my $date = parse_iso_date $msg->{date_received};
        %= join('/', $date->{mday}, $date->{month}, $date->{year}) . " $date->{hour}:$date->{min}";
      </td>
      <td>
        %= $msg->{from}->[0]->{name} || $msg->{from}->[0]->{email};
      </td>
      <td>
        <a href="<%= url_for('read', id => $msg->{mid}) %>"> <%= $msg->{subject} || '_' %> </a>
      </td>
      <td>
        %= print_sizes10 $msg->{size};
      </td>
      <td>
        <input type=checkbox name=mail value="<%= $msg->{mid} %>" form=move-mail>
      </td>
    </tr>

  % }
  </tbody>
</table>