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_bot_nav.html.ep | 32 +++++++++++--------------- templates/headers/_display_headers.html.ep | 37 ++++++++++++++++-------------- templates/headers/_display_top_nav.html.ep | 13 ++++++----- templates/headers/_displayfolders.html.ep | 18 ++++++++++----- 4 files changed, 53 insertions(+), 47 deletions(-) (limited to 'templates/headers') diff --git a/templates/headers/_display_bot_nav.html.ep b/templates/headers/_display_bot_nav.html.ep index 107ac67..ea1ce3c 100644 --- a/templates/headers/_display_bot_nav.html.ep +++ b/templates/headers/_display_bot_nav.html.ep @@ -12,34 +12,30 @@ - - + : + -
- - - + %= form_for move => (id => 'move-mail') => begin + %= label_for 'select-folder' => l('move') . ' ' . l('to') + %= select_field folder => [grep {$_ ne $folder} @$mail_folders] => (id => 'select-folder') %= csrf_field - - -
+ %= submit_button l 'move' + % end - \ No newline at end of file + 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 % } diff --git a/templates/headers/_display_top_nav.html.ep b/templates/headers/_display_top_nav.html.ep index 5888cb3..2b882af 100644 --- a/templates/headers/_display_top_nav.html.ep +++ b/templates/headers/_display_top_nav.html.ep @@ -6,18 +6,19 @@ %# <%= TXT 'userconfig' %> %# <%= TXT 'addressbook' %>
  • - <%= ucfirst l 'logout' %> + %= link_to ucfirst(l 'logout') => 'logout'
  • - <%= ucfirst l 'compose' %> + %= link_to ucfirst(l 'compose') => 'write'
  • -
    - : -
    + %= form_for '' => begin + %= label_for search => ucfirst(l 'search') . ': ' + %= search_field search => (size => 8) + % end @@ -30,4 +31,4 @@ - \ No newline at end of file + diff --git a/templates/headers/_displayfolders.html.ep b/templates/headers/_displayfolders.html.ep index 8cff0ed..7bc5b12 100644 --- a/templates/headers/_displayfolders.html.ep +++ b/templates/headers/_displayfolders.html.ep @@ -2,25 +2,31 @@ - <%= l($folder) || $folder %> + + %= l($folder) || $folder + - <%= $first_item %>-<%= $last_item %> <%= l 'of' %> <%= $total_items %> <%= l 'messages' %>\ - <%= ", $total_new_mails " . l('new') if $total_new_mails > 0; =%> + <%= "$first_item - $last_item " . l('of') . " $total_items " . l('messages') %>\ + <%= ", $total_new_mails " . l('new') if $total_new_mails > 0 =%> % if ($total_size) { - - <%= ucfirst l('mbox_size') . ": " . print_sizes10 $total_size %> + - <%= ucfirst(l 'mbox_size') . ": " . print_sizes10 $total_size %> % } - \ No newline at end of file + -- cgit v1.2.3