diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-02-26 21:36:27 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-02-26 21:36:27 +0100 |
commit | 2abf462ca10c4ac8c4f815e608cad31851e966e3 (patch) | |
tree | ed18c4a4039a5972edc0b81ed79c9d57480f8e70 /templates | |
parent | d0ffe11bd365b68d4da252b39d06d99f75d8cacb (diff) |
Specified the interface for qmauth
Changes to configuration
Added qmauth version written in Python
Slight changes to pagination
Diffstat (limited to 'templates')
-rw-r--r-- | templates/headers/_display_bot_nav.html.ep | 18 | ||||
-rw-r--r-- | templates/headers/_display_folders.html.ep | 8 | ||||
-rw-r--r-- | templates/headers/_display_headers.html.ep | 15 | ||||
-rw-r--r-- | templates/headers/_pagination1.html.ep | 10 | ||||
-rw-r--r-- | templates/headers/_pagination2.html.ep | 10 | ||||
-rw-r--r-- | templates/webmail/readmail.html.ep | 43 |
6 files changed, 56 insertions, 48 deletions
diff --git a/templates/headers/_display_bot_nav.html.ep b/templates/headers/_display_bot_nav.html.ep index 5a58b77..7be2832 100644 --- a/templates/headers/_display_bot_nav.html.ep +++ b/templates/headers/_display_bot_nav.html.ep @@ -10,14 +10,16 @@ </div> <div class="pure-u-1-1 pure-u-md-1-2"> - %= form_for move => (id => 'move-mail') => (class => 'pure-form') => begin - <fieldset> - %= label_for 'select-folder' => l('move to') - %= select_field folder => [grep {$_ ne $folder} @$mail_folders] => (id => 'select-folder') - %= csrf_field - %= submit_button l('move') => (class => 'pure-button') - </fieldset> - % end + % if (grep {$_ ne $folder} @$mail_folders) { + %= form_for move => (id => 'move-mail') => (class => 'pure-form') => begin + <fieldset> + %= label_for 'select-folder' => l('move to') + %= select_field folder => [map { $_ ? $_ : l 'Home' } grep {$_ ne $folder} @$mail_folders] => (id => 'select-folder') + %= csrf_field + %= submit_button l('move') => (class => 'pure-button') + </fieldset> + % end + % } </div> </div> diff --git a/templates/headers/_display_folders.html.ep b/templates/headers/_display_folders.html.ep index 856844d..7f1612f 100644 --- a/templates/headers/_display_folders.html.ep +++ b/templates/headers/_display_folders.html.ep @@ -8,10 +8,10 @@ </strong> <ul class="pure-menu-list"> -% for my $v (grep {$_ ne $folder} @$mail_folders) { +% for (grep {$_ ne $folder} @$mail_folders) { <li class="pure-menu-item"> - %= link_to '' => {folder => $v} => (class => 'bright') => begin - %= l($v || '_mailbox_root') + %= link_to '' => {folder => $_} => (class => 'bright') => begin + %= l($_ || '_mailbox_root') % end </li> % } @@ -21,7 +21,7 @@ </div> <p class="pure-u-1-1 pure-u-md-1-2"> - <%= l('[_1] of [_2] messages', $last_item - $first_item + 1, $total_items) %>\ + <%= l('[_1] of [_2] messages', $this_page->[1] - $this_page->[0], $total_items) %>\ <%= l(', [_1] new', $total_new_mails) if $total_new_mails > 0 =%> <%= l(' - mailbox size: [_1]', print_sizes10 $total_size) if $total_size %> </p> diff --git a/templates/headers/_display_headers.html.ep b/templates/headers/_display_headers.html.ep index 42f927c..4dd36a1 100644 --- a/templates/headers/_display_headers.html.ep +++ b/templates/headers/_display_headers.html.ep @@ -66,9 +66,9 @@ % foreach my $msgnum ($first_item .. $last_item) { % my $msg = $msgs->[$msgnum - $first_item]; - %= tag tr => (class => $msg->{new} ? 'new-mail' : '') => (id => $msg->{mid}) => begin + %= tag tr => (class => $msg->{unread} ? 'new-mail' : '') => (id => $msg->{message_handle}) => begin <td class="hide-small"> - %= $msgnum + %= $msgnum + 1 </td> <td> @@ -76,7 +76,7 @@ <!-- <div class="pure-u-1-4"> - %# ucfirst($msg->{is_multipart} ? l('yes') : l('no')); + %# ucfirst($msg->{head}{mime}{content_maintype} eq 'multipart' ? l('yes') : l('no')); </div> --> @@ -86,22 +86,23 @@ </div> <div class="pure-u-16-24 pure-u-md-6-24"> - %= $msg->{head}{from}[0]{name} || $msg->{head}{from}[0]{email}; + <%= $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="pure-u-20-24 pure-u-md-12-24"> - %= link_to $msg->{head}{subject} || '_' => read => {id => $msg->{mid}} + %= link_to $msg->{head}{subject} || '_' => read => {id => $msg->{message_handle}} </div> <div class="pure-u-4-24 pure-u-md-2-24"> - %= print_sizes10 $msg->{size}; + %= print_sizes10 $msg->{byte_size}; </div> </div> </td> <td> - %= check_box mail => $msg->{mid} => (form => 'move-mail') + %= check_box mail => $msg->{message_handle} => (form => 'move-mail') </td> % end diff --git a/templates/headers/_pagination1.html.ep b/templates/headers/_pagination1.html.ep index 9b6121a..0e000f9 100644 --- a/templates/headers/_pagination1.html.ep +++ b/templates/headers/_pagination1.html.ep @@ -1,7 +1,7 @@ <div> - <a href="<%= url_with->query({start => $prev_page->[0]-1}) %>"><img src="/left.gif" alt="←"></a> - <a href="<%= url_with->query({start => $first_page->[0]-1}) %>"><img src="/first.gif" alt="↞"></a> - [<%= l('page [_1] of [_2]', $current_page, $total_pages) %>] - <a href="<%= url_with->query({start => $last_page->[0]-1}) %>"><img src="/last.gif" alt="↠"></a> - <a href="<%= url_with->query({start => $next_page->[0]-1}) %>"><img src="/right.gif" alt="→"></a> + <a href="<%= url_with->query({start => $prev_page->[0]}) %>"> ← </a> + <a href="<%= url_with->query({start => $first_page->[0]}) %>"> ↞ </a> + [<%= l('page [_1] of [_2]', $current_page+1, $total_pages) %>] + <a href="<%= url_with->query({start => $last_page->[0]}) %>"> ↠ </a> + <a href="<%= url_with->query({start => $next_page->[0]}) %>"> → </a> </div> diff --git a/templates/headers/_pagination2.html.ep b/templates/headers/_pagination2.html.ep index 236e9bb..63e8f63 100644 --- a/templates/headers/_pagination2.html.ep +++ b/templates/headers/_pagination2.html.ep @@ -1,10 +1,10 @@ <div> %= form_for '' => (class => 'pure-form') => begin - <a href="<%= url_with->query({start => $first_page->[0]-1}) %>"><img src="/first.gif" alt="<%= l('first') . ' ' . l 'page' %>"></a> - <a href="<%= url_with->query({start => $prev_page->[0]-1}) %>"><img src="/left.gif" alt="<%= l('previous') . ' ' . l 'page' %>"></a> + <a href="<%= url_with->query({start => $first_page->[0]}) %>"><img src="/first.gif" alt="<%= l('first') . ' ' . l 'page' %>"></a> + <a href="<%= url_with->query({start => $prev_page->[0]}) %>"><img src="/left.gif" alt="<%= l('previous') . ' ' . l 'page' %>"></a> [ %= label_for custompage => ucfirst l 'page' - %= number_field start => (id => 'custompage') => (size => 3) => (placeholder => $current_page) + %= number_field start => (id => 'custompage') => (size => 3) => (placeholder => $current_page+1) %= l 'of' %= $total_pages ] @@ -16,7 +16,7 @@ % } % } - <a href="<%= url_with->query({start => $next_page->[0]-1}) %>"><img src="/right.gif" alt="<%= l('next') . ' ' . l 'page' %>"></a> - <a href="<%= url_with->query({start => $last_page->[0]-1}) %>"><img src="/last.gif" alt="<%= l('last') . ' ' . l('page') %>"></a> + <a href="<%= url_with->query({start => $next_page->[0]}) %>"><img src="/right.gif" alt="<%= l('next') . ' ' . l 'page' %>"></a> + <a href="<%= url_with->query({start => $last_page->[0]}) %>"><img src="/last.gif" alt="<%= l('last') . ' ' . l('page') %>"></a> % end </div> diff --git a/templates/webmail/readmail.html.ep b/templates/webmail/readmail.html.ep index 5bad9f3..b5b48a1 100644 --- a/templates/webmail/readmail.html.ep +++ b/templates/webmail/readmail.html.ep @@ -2,10 +2,14 @@ % my $mail_fmt = begin % my ($category, $value) = @_; - <dt> <%= ucfirst l $category %> </dt> - <dd> - %= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value - </dd> + % if (ref $value eq 'ARRAY' && $value->@*) { + <dt> <%= uc l $category %> </dt> + % for ($value->@*) { + <dd> + %= $_->{name} ? qq("$_->{name}" <$_->{address}>) : "$_->{address}" + </dd> + % } + % } % end <div class="jwm-base"> @@ -16,42 +20,43 @@ <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} } + %= $mail_fmt->(from => $msg->{head}{from}) + %= $mail_fmt->(to => $msg->{head}{to}) + %= $mail_fmt->(cc => $msg->{head}{cc}) + %= $mail_fmt->(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> - + % my $content_type = $msg->{head}{mime}{content_maintype} . '/' . $msg->{head}{mime}{content_subtype}; <dt> <%= uc l 'content-type' %> </dt> - <dd> <%= $msg->{head}{content_type} %> </dd> + <dd> <%= $content_type %> </dd> </dl> % my $body = $msg->{body}; -% if ($msg->{head}{content_type} eq 'multipart/alternative') { -% for (reverse @$body) { +% if ($content_type eq 'multipart/alternative') { +% for (reverse @{$body->{parts}}) { <div class=jwm-mail-body> -% my $x = mime_render($_->{head}{content_type}, $_->{body}); +% my $x = mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body}); %== $x; </div> % last if $x; % } % } -% elsif (ref $body eq 'HASH') { -% for (%$body) { +% elsif ($msg->{head}{mime}{content_maintype} eq 'multipart') { +% for (@{$body->{parts}}) { <div class=jwm-mail-body> - %== mime_render($_->{head}{content_type}, $_->{body}); + %== mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body}); </div> % } % } +% elsif ($msg->{head}{mime}{content_maintype} eq 'message') { +% die "not implemented" +% } % else { <div class=jwm-mail-body> - %== mime_render($msg->{head}{content_type}, $body); + %== mime_render($content_type, $body); </div> % } |