From ee43823179ee627ac16ea9da8168e5f1bf9619c0 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Thu, 29 Oct 2020 12:13:04 +0100 Subject: Initial commit; Stable version --- templates/_pagination1.html.ep | 5 ++ templates/_pagination2.html.ep | 19 ++++++ templates/error.html.ep | 27 +++++++++ templates/headers/_display_bot_nav.html.ep | 45 ++++++++++++++ templates/headers/_display_headers.html.ep | 94 ++++++++++++++++++++++++++++++ templates/headers/_display_top_nav.html.ep | 33 +++++++++++ templates/headers/_displayfolders.html.ep | 26 +++++++++ templates/layouts/mainlayout.html.ep | 21 +++++++ templates/not_found_.html.ep | 16 +++++ templates/webmail/about.html.ep | 71 ++++++++++++++++++++++ templates/webmail/displayheaders.html.ep | 46 +++++++++++++++ templates/webmail/noaction.html.ep | 60 +++++++++++++++++++ templates/webmail/readmail.html.ep | 52 +++++++++++++++++ templates/webmail/writemail.html.ep | 50 ++++++++++++++++ 14 files changed, 565 insertions(+) create mode 100644 templates/_pagination1.html.ep create mode 100644 templates/_pagination2.html.ep create mode 100644 templates/error.html.ep create mode 100644 templates/headers/_display_bot_nav.html.ep create mode 100644 templates/headers/_display_headers.html.ep create mode 100644 templates/headers/_display_top_nav.html.ep create mode 100644 templates/headers/_displayfolders.html.ep create mode 100644 templates/layouts/mainlayout.html.ep create mode 100644 templates/not_found_.html.ep create mode 100644 templates/webmail/about.html.ep create mode 100644 templates/webmail/displayheaders.html.ep create mode 100644 templates/webmail/noaction.html.ep create mode 100644 templates/webmail/readmail.html.ep create mode 100644 templates/webmail/writemail.html.ep (limited to 'templates') 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 @@ +← +↞ +[<%= join(' ', ucfirst l('page'), $current_page, l('of'), $total_pages) %>] +↠ +→ 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 @@ + <%= l('first') . ' ' . l 'page' %>\ + <%= l('previous') . ' ' . l 'page' %> \ + +
+ [ + + <%= l 'of' %> <%= $total_pages %>] + +% my $h = $c->req->query_params->to_hash; +% while (my ($k, $v) = each %$h) { +% if ($k ne 'start') { + +% } +% } + +
\ + + <%= l('next') . ' ' . l 'page' %> \ + <%= l('last') . ' ' . l('page') %> \ 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 @@ + + + + Error + + + +

Error

+

+% if (my $msg = stash 'error') { +%= $msg +% } +% else { + Uwu :( +% } +

+% if (my $see_other = stash 'links') { + See: + +% } + + + \ 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 @@ + + + + + + + + + + + + + + + +
+ %= include '_pagination1'; + + + + +
+ + + + %= csrf_field + + +
+ +
+ + + \ 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; + + + + % no warnings qw(experimental::smartmatch); + %= do { given (param('sort')) { '↑' when ($param); '↓' when ('!' . $param) } } + %= ucfirst l $param; + + + +% end + + + + + + + + + + + + + + + + + + %= $sort_param->('status'); + + %= $sort_param->('date'); + + + % if ($folder ne "SENT") { + %= $sort_param->('sender'); + % } else { + + % } + + %= $sort_param->('subject'); + + %= $sort_param->('size'); + + + + + + + + % foreach my $msgnum ($first_item .. $last_item) { + % my $msg = $msgs->[$msgnum - $first_item]; + + + + + + + + + + + + % } + +
<%= ucfirst l 'nr' %> + + <%= ucfirst l 'recipient' %> + % if (param('sort') eq "sender") { + v + % } elsif (param('sort') eq "recipient_rev") { + ^ + % } + + + + +
+ %= $msgnum + + %= ucfirst($msg->{is_multipart} ? l('yes') : l('no')); + + % 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"; + + %= $msg->{from}->[0]->{name} || $msg->{from}->[0]->{email}; + + <%= $msg->{subject} || '_' %> + + %= print_sizes10 $msg->{size}; + + +
\ 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 @@ + + + + + + + + + + + + +
+ + +
+ : +
+
+ %= include '_pagination2'; + + + %#
+
\ 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 @@ + + + + + + + + +
+ <%= l($folder) || $folder %> + + + + + <%= $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 %> +% } + +
\ 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 @@ + + + + + + <%= stash('title') || 'JWebmail' %> + + + + + %= content + + + + 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 @@ + + + + Not Found + + + +

+ Not the page you are looking for. +

+

+ Go back or go to the start page. +

+ + + \ 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'; + + + + + + + + + + + + + + +
+ About JWebmail <%= $version %> +
+
    +
  • + JWebmail <%= $version %> is a Webmail solution meant to be used with + s/qmail +
  • + +
  • Features: +
      + +
    • multiple language support
    • +
    • session management
    • +
    • search for mails
    • +
    • CGI support but also psgi/plack and fcgi
    • +
    +
  • + +
  • + This is a + GPL + licensed project, created by Oliver 'omnis' Müller + and currently maintained by + Jannis M. Hoffmann +
  • + + +
  • Supported languages: +

    +% foreach (@$languages) { + <%= $_ %> +% } +

    +
  • + +
  • + JWebmail is programmed in Perl, and is + a complete rewrite of oMail-webmail. +
  • + +
+
+ +
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'; + + + + + + + + +% if (my $loginmessage = stash 'loginmessage') { + + + +% } + + + + + + + + + + + + + + + + + + +
+ %= include 'headers/_displayfolders'; +
<%= $loginmessage %>
+% if (@$msgs) { + %= include 'headers/_display_headers'; +% } +% else { +

<%= l 'empty_folder' %>

+% } +
\ 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'; + + + + + + + + + +% if (my $msg = flash('message') || stash('warning')) { + + +% } + + + + + + +
JWebmail – <%= ucfirst l 'login' %>
+ %= $msg + +
+ +%= 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) = @_; +
<%= ucfirst l $category %>
+
<%= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value %>
+% end + +
+ +

Read Mail

+ +
+
<%= uc l 'subject' %>
+
<%= $msg->{subject} %>
+%= $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} }; +
<%= uc l 'date' %>
+
<%= $msg->{date} %>
+
<%= uc l 'size' %>
+
<%= print_sizes10 $msg->{size} %>
+
<%= uc l 'content-type' %>
+
<%= $msg->{content_type} %>
+
+ +% my $body = $msg->{body}; + +% if ($msg->{content_type} eq 'multipart/alternative') { +% for (reverse @$body) { +
+% my $x = mime_render($_->{type}, $_->{val}); +%== $x; +% last if $x; +
+% } +% } +% elsif (ref $body eq 'HASH') { +% for (%$body) { +
+%== mime_render($_->{type}, $_->{val}); +
+% } +% } +% else { +
+%== mime_render($msg->{content_type}, $body); +
+% } + +
\ 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'; + +
+ +

Write Message

+ +% if (my $msg = stash('warning')) { +

<%= $msg %>

+% } + +
+ + + %= email_field 'to', id => 'mail', multiple => '', required => '' +
+ + + %= text_field 'subject', 'required' => '' +
+ + + %= email_field 'cc', 'multiple' => '' +
+ + + %= email_field 'bcc', 'multiple' => '' +
+ + + %= email_field 'back_to' +
+ + + %= text_area 'body', cols => 80, rows => 24, id => 'txt' +
+ + %= file_field 'attach' +
+ + + + %= csrf_field + +
+ + + +
\ No newline at end of file -- cgit v1.2.3