From 72ae9b3f63ddbe296f3e4e8f8db2d29303163d68 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sun, 1 May 2022 22:06:03 +0200 Subject: use more tag helpers in templates --- templates/headers/_display_headers.html.ep | 37 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'templates/headers/_display_headers.html.ep') diff --git a/templates/headers/_display_headers.html.ep b/templates/headers/_display_headers.html.ep index d3f9457..c278a37 100644 --- a/templates/headers/_display_headers.html.ep +++ b/templates/headers/_display_headers.html.ep @@ -2,11 +2,11 @@ % my $param = shift; - + %= link_to url_with->query(sort => $param eq (param('sort') || '') ? '!' . $param : $param) => begin % no warnings qw(experimental::smartmatch); %= do { given (param('sort')) { '↑' when ($param); '↓' when ('!' . $param) } } %= ucfirst l $param; - + % end % end @@ -25,25 +25,28 @@ - <%= ucfirst l 'nr' %> + + %= ucfirst l 'nr' + %= $sort_param->('status'); %= $sort_param->('date'); - % if ($folder ne "SENT") { %= $sort_param->('sender'); - % } else { + % } + % else { - - <%= ucfirst l 'recipient' %> - % if (param('sort') eq "sender") { - v - % } elsif (param('sort') eq "recipient_rev") { - ^ - % } - + %= link_to url_with->query(sort => param('sort') ne '!sender' ? 'sender' : '!sender' ) => begin + %= ucfirst l 'recipient' + % if (param('sort') eq "sender") { + %= image '/down.gif' => (width => 12) => (height => 12) => (border => 0) => (alt => 'v') + % } + % elsif (param('sort') eq "recipient_rev") { + %= image '/up.gif' => (width => 12) => (height => 12) => (border => 0) => (alt => '^') + % } + % end % } @@ -63,7 +66,7 @@ % foreach my $msgnum ($first_item .. $last_item) { % my $msg = $msgs->[$msgnum - $first_item]; - + %= tag tr => (class => $msg->{new} ? 'new-mail' : '') => (id => $msg->{mid}) => begin %= $msgnum @@ -78,15 +81,15 @@ %= $msg->{head}{from}[0]{name} || $msg->{head}{from}[0]{email}; - <%= $msg->{head}{subject} || '_' %> + %= link_to $msg->{head}{subject} || '_' => read => {id => $msg->{mid}} %= print_sizes10 $msg->{size}; - + %= check_box mail => $msg->{mid} => (form => 'move-mail') - + % end % } -- cgit v1.2.3