diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_pagination1.html.ep | 5 | ||||
-rw-r--r-- | templates/_pagination2.html.ep | 19 | ||||
-rw-r--r-- | templates/error.html.ep | 27 | ||||
-rw-r--r-- | templates/headers/_display_bot_nav.html.ep | 45 | ||||
-rw-r--r-- | templates/headers/_display_headers.html.ep | 94 | ||||
-rw-r--r-- | templates/headers/_display_top_nav.html.ep | 33 | ||||
-rw-r--r-- | templates/headers/_displayfolders.html.ep | 26 | ||||
-rw-r--r-- | templates/layouts/mainlayout.html.ep | 21 | ||||
-rw-r--r-- | templates/not_found_.html.ep | 16 | ||||
-rw-r--r-- | templates/webmail/about.html.ep | 71 | ||||
-rw-r--r-- | templates/webmail/displayheaders.html.ep | 46 | ||||
-rw-r--r-- | templates/webmail/noaction.html.ep | 60 | ||||
-rw-r--r-- | templates/webmail/readmail.html.ep | 52 | ||||
-rw-r--r-- | templates/webmail/writemail.html.ep | 50 |
14 files changed, 565 insertions, 0 deletions
diff --git a/templates/_pagination1.html.ep b/templates/_pagination1.html.ep new file mode 100644 index 0000000..14354c0 --- /dev/null +++ b/templates/_pagination1.html.ep @@ -0,0 +1,5 @@ +<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> +[<%= join(' ', ucfirst l('page'), $current_page, l('of'), $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> diff --git a/templates/_pagination2.html.ep b/templates/_pagination2.html.ep new file mode 100644 index 0000000..f838841 --- /dev/null +++ b/templates/_pagination2.html.ep @@ -0,0 +1,19 @@ +<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>\ + +<form> + [<label for=custompage><%= ucfirst l 'page' %></label> + <input type=number name=start id=custompage placeholder="<%= $current_page %>" size=3 /> + <%= l 'of' %> <%= $total_pages %>] + +% my $h = $c->req->query_params->to_hash; +% while (my ($k, $v) = each %$h) { +% if ($k ne 'start') { + <input type=hidden name="<%=$k%>" value="<%=$v%>" /> +% } +% } + +</form>\ + +<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>
\ No newline at end of file diff --git a/templates/error.html.ep b/templates/error.html.ep new file mode 100644 index 0000000..92391d6 --- /dev/null +++ b/templates/error.html.ep @@ -0,0 +1,27 @@ +<html> + + <head> + <title>Error</title> + </head> + + <body> + <h1>Error</h1> + <p class=center> +% if (my $msg = stash 'error') { +%= $msg +% } +% else { + Uwu :( +% } + </p> +% if (my $see_other = stash 'links') { + See: + <nav> + % for (@$see_other) { + <a href="<%= $_ %>"> <%= $_ %> </a><br> + % } + </nav> +% } + </body> + +</html>
\ No newline at end of file diff --git a/templates/headers/_display_bot_nav.html.ep b/templates/headers/_display_bot_nav.html.ep new file mode 100644 index 0000000..107ac67 --- /dev/null +++ b/templates/headers/_display_bot_nav.html.ep @@ -0,0 +1,45 @@ +<table id=bot-nav width=100%> + + <colgroup> + <col width=70% /> + <col width=10% /> + <col width=20% /> + </colgroup> + + <tr> + <td> + %= include '_pagination1'; + </td> + + <td> + <label for=allbox><%= l 'check_all' %>: </label> + <input name=allbox type=checkbox onclick="check_all(this);"> + </td> + + <td> + <form id=move-mail action="<%= url_for('move') %>" method=post> + <label for=select-folder> <%= l('move') . ' ' . l('to') %> </label> + <select name=folder id=select-folder> + %== "<option value='$_'>$_</option>" for grep {$_ ne $folder} @$mail_folders; + </select> + + %= csrf_field + + <input type="submit" value="<%= l 'move' %>"> + </form> + + </td> + </tr> +</table> + + +<script> +function check_all(box) { + const setTo = box.checked; + const mails = document.getElementById('mail-headers').tBodies[0].rows; + + for (const m of mails) { + m.lastElementChild.children[0].checked = setTo; + } +} +</script>
\ No newline at end of file diff --git a/templates/headers/_display_headers.html.ep b/templates/headers/_display_headers.html.ep new file mode 100644 index 0000000..67e60b4 --- /dev/null +++ b/templates/headers/_display_headers.html.ep @@ -0,0 +1,94 @@ +% 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> + % sub d { qr/([[:digit:]]{$_[0]})/ } + % my ($year,$mon,$mday,$hour,$min,$sec) = $msg->{date} =~ m/@{[d(4).'-'.d(2).'-'.d(2).'T'.d(2).':'.d(2).':'.d(2).'Z']}/; + %= join('/', $mday, $mon, $year) . " $hour:$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>
\ No newline at end of file diff --git a/templates/headers/_display_top_nav.html.ep b/templates/headers/_display_top_nav.html.ep new file mode 100644 index 0000000..5888cb3 --- /dev/null +++ b/templates/headers/_display_top_nav.html.ep @@ -0,0 +1,33 @@ +<table width=100%> + <tr> + + <td> + <ul class=line> + %# <a href="<%= url_with($prefsurl) %>"><%= TXT 'userconfig' %></a> + %# <a href="<%=$prefsurl%>?action=editaddresses&folder=<%=$folder%>&sessionid=<%=$thissession%>&sort=<%=$sort%>&firstmessage=<%=$firstmessage+1%>&lang=<%=$lang%>" ><%= TXT 'addressbook' %></a> + <li> + <a href="<%= url_for('logout') %>"><%= ucfirst l 'logout' %></a> + </li> + <li> + <a href="<%= url_for('write') %>" ><%= ucfirst l 'compose' %></a> + </li> + </ul> + </td> + + <td> + <form action="<%= url_for %>"> + <label for=search><%= ucfirst l 'search' %></label>: <input type=search name=search size=8> + </form> + </td> + + <td id=pag2> + %= include '_pagination2'; + </td> + + <td> + <!-- delete button --> + %# <form action="<%= url_for('delete_msg') %>" name=Formdel onsubmit="return confirm('<%= TXT q(js_confirm_delete) %>')" > </form> + </td> + + </tr> +</table>
\ No newline at end of file diff --git a/templates/headers/_displayfolders.html.ep b/templates/headers/_displayfolders.html.ep new file mode 100644 index 0000000..8cff0ed --- /dev/null +++ b/templates/headers/_displayfolders.html.ep @@ -0,0 +1,26 @@ +<table id=display-folders width=100%> + <tr> + + <td id=folder-list class=alter-font> + <strong class=up> <%= l($folder) || $folder %> </strong> + + <ul class=line> +% for my $v (grep {$_ ne $folder} @$mail_folders) { + <li><a href="<%= url_for(folder => $v) %>" class=bright> <%= $v ne '' ? (l($v) || $v) : l 'Home' %> </a></li> +% } + </ul> + </td> + + <td> + <em class=msg-count> + <%= $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 %> +% } + </em> + </td> + + </tr> +</table>
\ No newline at end of file diff --git a/templates/layouts/mainlayout.html.ep b/templates/layouts/mainlayout.html.ep new file mode 100644 index 0000000..e084578 --- /dev/null +++ b/templates/layouts/mainlayout.html.ep @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset=UTF-8> + +<html lang="<%= $lang %>"> + <head> + <title> <%= stash('title') || 'JWebmail' %> </title> + <link href="/style.css" rel=stylesheet> + </head> + + <body> + %= content + + <footer> + <a href="<%= url_for('about') %>"> + <%= ucfirst l 'about' %> JWebmail + </a> + <br/> + <%= ucfirst l 'version' %> <%= $version %> + </footer> + </body> +</html> diff --git a/templates/not_found_.html.ep b/templates/not_found_.html.ep new file mode 100644 index 0000000..d1b353f --- /dev/null +++ b/templates/not_found_.html.ep @@ -0,0 +1,16 @@ +<html> + + <head> + <title>Not Found</title> + </head> + + <body> + <p class=center> + Not the page you are looking for. + </p> + <p class=center> + Go back or go to the <a href="<%= url_for 'noaction' %>">start page</a>. + </p> + </body> + +</html>
\ No newline at end of file diff --git a/templates/webmail/about.html.ep b/templates/webmail/about.html.ep new file mode 100644 index 0000000..c6d1247 --- /dev/null +++ b/templates/webmail/about.html.ep @@ -0,0 +1,71 @@ +%# about template + +% layout 'mainlayout'; + +<table class=top> + + <tr> + <th> + About JWebmail <%= $version %> + </th> + </tr> + + <tr> + <td class=large-section> + <ul> + <li> + JWebmail <%= $version %> is a Webmail solution meant to be used with + <a href="https://www.fehcom.de/sqmail/sqmail.html">s/qmail</a> + </li> + + <li>Features: + <ul> + <!-- + <li>qmail, vmailmgr and vpopmail authentication support (<em>not</em> sendmail)</li> + <li>multiple signatures und headers support</li> + <li>basic folders support (4 defined folders)</li> + <li>featured addressbook</li> + <li>100% Maildir based</li> + <li>reads the mail directely from the server disk, without need for POP3 or IMAP</li> + --> + <li>multiple language support</li> + <li>session management </li> + <li>search for mails</li> + <li>CGI support but also psgi/plack and fcgi</li> + </ul> + </li> + + <li> + This is a + <a href="http://www.gnu.org/copyleft/gpl.html" target="_new">GPL</a> + licensed project, created by <a href="mailto:">Oliver 'omnis' Müller</a> + and currently maintained by + <a href="mailto:jannis@fehcom.de">Jannis M. Hoffmann</a> + </li> + + + <li>Supported languages: + <p class=languages> +% foreach (@$languages) { + <%= $_ %> +% } + </p> + </li> + + <li> + JWebmail is programmed in <a href="http://www.perl.org">Perl</a>, and is + a complete rewrite of oMail-webmail. + </li> + + </ul> + </td> + </tr> + + <tr> + <td> + <nav> + <a href="<%= url_for('noaction') %>" class=btn>login</a> + </nav> + </td> + </tr> +</table> diff --git a/templates/webmail/displayheaders.html.ep b/templates/webmail/displayheaders.html.ep new file mode 100644 index 0000000..d823d9e --- /dev/null +++ b/templates/webmail/displayheaders.html.ep @@ -0,0 +1,46 @@ +% layout 'mainlayout'; + +<table id=displayheaders> + + <thead> + <tr> + <td id=folders> + %= include 'headers/_displayfolders'; + </td> + </tr> + +% if (my $loginmessage = stash 'loginmessage') { + <tr> + <td id=loginmessage> <%= $loginmessage %> </td> + </tr> +% } + + <tr> + <td id=navigation> + %= include 'headers/_display_top_nav'; + </td> + </tr> + </thead> + + <tbody> + <tr> + <td> +% if (@$msgs) { + %= include 'headers/_display_headers'; +% } +% else { + <p id=empty> <%= l 'empty_folder' %> </p> +% } + </td> + </tr> + </tbody> + + <tfoot> + <tr> + <td class=navigation> + %= include 'headers/_display_bot_nav'; + </td> + </tr> + </tfoot> + +</table>
\ No newline at end of file diff --git a/templates/webmail/noaction.html.ep b/templates/webmail/noaction.html.ep new file mode 100644 index 0000000..54a8106 --- /dev/null +++ b/templates/webmail/noaction.html.ep @@ -0,0 +1,60 @@ +% layout 'mainlayout'; + +<table id=noaction> + <thead> + <tr> + <th id=top-section> JWebmail – <%= ucfirst l 'login' %> </th> + </tr> + </thead> + + <tbody> +% if (my $msg = flash('message') || stash('warning')) { + <tr> + <td class="warning flash-fade"> + %= $msg + <td> + </tr> +% } + + <tr> + <td class=login-form> + <form method=post name=login1 action="<%= url_for('login') %>"> + + <table> + <tr> + <td class=label-cell> + <label for=userid><%= ucfirst l 'userid' %></label>: + </td> + <td> + %= text_field 'userid' + </td> + </tr> + <tr> + <td class=label-cell> + <label for=password><%= ucfirst l 'passwd' %></label>: + </td> + <td> + %= password_field 'password' + </td> + </tr> + <tr class=submit-row> + <td colspan=2> + <input type=submit value="<%= l 'login' %>"> + </td> + </tr> + </table> + + </form> + </td> + </tr> + + </tbody> +</table> + +%= javascript begin + if (!document.login1.userid.value) { + document.login1.userid.focus(); + } else { + document.login1.password.focus(); + } +% end diff --git a/templates/webmail/readmail.html.ep b/templates/webmail/readmail.html.ep new file mode 100644 index 0000000..f537d96 --- /dev/null +++ b/templates/webmail/readmail.html.ep @@ -0,0 +1,52 @@ +% layout 'mainlayout'; + +% my $mail_fmt = begin + % my ($category, $value) = @_; + <dt> <%= ucfirst l $category %> </dt> + <dd> <%= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value %> </dd> +% end + +<div class=ow> + +<h1>Read Mail</h1> + +<dl id=show-head> + <dt> <%= uc l 'subject' %> </dt> + <dd> <%= $msg->{subject} %> </dd> +%= $mail_fmt->('from', $msg->{from}); +%= $mail_fmt->('to', $msg->{to}); +%= $mail_fmt->('cc', $msg->{cc}) if !ref $msg->{cc} || @{ $msg->{cc} }; +%= $mail_fmt->('bcc', $msg->{bcc}) if !ref $msg->{bcc} || @{ $msg->{cc} }; + <dt> <%= uc l 'date' %> </dt> + <dd> <%= $msg->{date} %> </dd> + <dt> <%= uc l 'size' %> </dt> + <dd> <%= print_sizes10 $msg->{size} %> </dd> + <dt> <%= uc l 'content-type' %> </dt> + <dd> <%= $msg->{content_type} %> </dd> +</dl> + +% my $body = $msg->{body}; + +% if ($msg->{content_type} eq 'multipart/alternative') { +% for (reverse @$body) { + <div class=show-body> +% my $x = mime_render($_->{type}, $_->{val}); +%== $x; +% last if $x; + </div> +% } +% } +% elsif (ref $body eq 'HASH') { +% for (%$body) { + <div class=show-body> +%== mime_render($_->{type}, $_->{val}); + </div> +% } +% } +% else { + <div class=show-body> +%== mime_render($msg->{content_type}, $body); + </div> +% } + +</div>
\ No newline at end of file diff --git a/templates/webmail/writemail.html.ep b/templates/webmail/writemail.html.ep new file mode 100644 index 0000000..171542e --- /dev/null +++ b/templates/webmail/writemail.html.ep @@ -0,0 +1,50 @@ +% layout 'mainlayout'; + +<div class=ow> + +<h1>Write Message</h1> + +% if (my $msg = stash('warning')) { + <p class=warn> <%= $msg %> </p> +% } + +<form method=post enctype=multipart/form-data id=write-form> + + <label for=mail> <%= ucfirst l 'send_to' %> </label> + %= email_field 'to', id => 'mail', multiple => '', required => '' + <br> + + <label for=subject> <%= ucfirst l 'subject' %> </label> + %= text_field 'subject', 'required' => '' + <br> + + <label for=cc>CC</label> + %= email_field 'cc', 'multiple' => '' + <br> + + <label for=bcc>BCC</label> + %= email_field 'bcc', 'multiple' => '' + <br> + + <label for=back_to> <%= ucfirst l 'answer_to' %> </label> + %= email_field 'back_to' + <br> + + <label for=txt> <%= ucfirst l 'content' %> </label> + %= text_area 'body', cols => 80, rows => 24, id => 'txt' + <br> + + %= file_field 'attach' + <br> + + <input type=submit value="send" /> + + %= csrf_field + +</form> + +<nav> +<a href="<%= url_for('displayheaders') %>" class=btn> <%= l 'home' %> </a> +</nav> + +</div>
\ No newline at end of file |