summaryrefslogtreecommitdiff
path: root/templates/displayheaders/_main_table.html.ep
blob: 6ba33fa29d8f1bdba452c701c8f09b50a8b5ef07 (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
% my $sort_param = begin
  % my $param = shift;

  %= link_to url_with->query(sort => $param eq (param('sort') || '') ? '!' . $param : $param) => begin
    % no warnings qw(experimental::smartmatch);
    %= do { if (param('sort') eq '↑') { $param } elsif (param('sort') eq '↓') { '!' . $param } else { die } }
    %= ucfirst l $param;
  % end

% end

<section class="box">

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

    %= tag div => (class => $msg->{unread} ? 'media jwm-new-mail' : 'media') => (id => $msg->{message_handle}) => begin
      <div class="media-left is-hidden-mobile">
        %= $msgnum + 1
      </div>

      <div class="media-content">
        <div class=" columns is-gapless is-multiline">
          <div class="column is-10">
            <%= $msg->{head}{sender}[0]{display_name} || $msg->{head}{sender}[0]{address} ||
                $msg->{head}{from}[0]{display_name} || $msg->{head}{from}[0]{address}; %>
          </div>

          <div class="column is-2">
            % my $date = $v->parse_iso_date($msg->{head}{date});
            %= join('/', $date->{mday}, $date->{month}, $date->{year}) . " $date->{hour}:$date->{min}";
          </div>

          <div class="column is-10">
            %= link_to $msg->{head}{subject} || '_' => read => {id => $msg->{message_handle}}
          </div>

          <div class="column is-2">
            %= $v->print_sizes10($msg->{byte_size});
          </div>
        </div>
      </div>

      <div class=media-right>
        %= check_box mail => $msg->{message_handle} => (form => 'move-mail') => (form => 'remove-mail') => (class => 'jwm-mail-checkbox')
      </div>
    % end

  % }

</section>