From d897eeee5c4d163891d0b6a8f85d328ccada7575 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 16 Dec 2019 12:51:42 +0100 Subject: Introduce base plugin This plugin offers base IMAP/SMTP functionality. References: https://todo.sr.ht/~sircmpwn/koushin/39 --- plugins/base/public/assets/style.css | 1 + plugins/base/public/compose.html | 26 ++++++++++++++++ plugins/base/public/foot.html | 2 ++ plugins/base/public/head.html | 8 +++++ plugins/base/public/login.html | 14 +++++++++ plugins/base/public/mailbox.html | 45 ++++++++++++++++++++++++++++ plugins/base/public/message.html | 58 ++++++++++++++++++++++++++++++++++++ 7 files changed, 154 insertions(+) create mode 100644 plugins/base/public/assets/style.css create mode 100644 plugins/base/public/compose.html create mode 100644 plugins/base/public/foot.html create mode 100644 plugins/base/public/head.html create mode 100644 plugins/base/public/login.html create mode 100644 plugins/base/public/mailbox.html create mode 100644 plugins/base/public/message.html (limited to 'plugins/base/public') diff --git a/plugins/base/public/assets/style.css b/plugins/base/public/assets/style.css new file mode 100644 index 0000000..8f414f5 --- /dev/null +++ b/plugins/base/public/assets/style.css @@ -0,0 +1 @@ +/* TODO */ diff --git a/plugins/base/public/compose.html b/plugins/base/public/compose.html new file mode 100644 index 0000000..2a52675 --- /dev/null +++ b/plugins/base/public/compose.html @@ -0,0 +1,26 @@ +{{template "head.html"}} + +

koushin

+ +

+ Back +

+ +

Compose new message

+ +
+ + +

From:

+ +

To:

+ +

Subject:

+ +

Body:

+ +

+ +
+ +{{template "foot.html"}} diff --git a/plugins/base/public/foot.html b/plugins/base/public/foot.html new file mode 100644 index 0000000..b605728 --- /dev/null +++ b/plugins/base/public/foot.html @@ -0,0 +1,2 @@ + + diff --git a/plugins/base/public/head.html b/plugins/base/public/head.html new file mode 100644 index 0000000..bed1bb3 --- /dev/null +++ b/plugins/base/public/head.html @@ -0,0 +1,8 @@ + + + + + koushin + + + diff --git a/plugins/base/public/login.html b/plugins/base/public/login.html new file mode 100644 index 0000000..6ae1737 --- /dev/null +++ b/plugins/base/public/login.html @@ -0,0 +1,14 @@ +{{template "head.html"}} + +

koushin

+ +
+ + + + +

+ +
+ +{{template "foot.html"}} diff --git a/plugins/base/public/mailbox.html b/plugins/base/public/mailbox.html new file mode 100644 index 0000000..ddd1260 --- /dev/null +++ b/plugins/base/public/mailbox.html @@ -0,0 +1,45 @@ +{{template "head.html"}} + +

koushin

+ +

+ Logout · Compose +

+ +

{{.Mailbox.Name}}

+ +

Mailboxes:

+ + +{{if .Messages}} +

Messages:

+ + +

+ {{if ge .PrevPage 0}} + Prev + {{end}} + {{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}} + {{if ge .NextPage 0}} + Next + {{end}} +

+{{else}} +

Mailbox is empty.

+{{end}} + +{{template "foot.html"}} diff --git a/plugins/base/public/message.html b/plugins/base/public/message.html new file mode 100644 index 0000000..729937d --- /dev/null +++ b/plugins/base/public/message.html @@ -0,0 +1,58 @@ +{{template "head.html"}} + +

koushin

+ +

+ + Back + +

+ +

+ {{if .Message.Envelope.Subject}} + {{.Message.Envelope.Subject}} + {{else}} + (No subject) + {{end}} +

+ +{{define "message-part-tree"}} + {{/* nested templates can't access the parent's context */}} + {{$ = index . 0}} + {{with index . 1}} + + {{if eq $.PartPath .PathString}}{{end}} + {{.String}} + {{if eq $.PartPath .PathString}}{{end}} + + {{if gt (len .Children) 0}} + + {{end}} + {{end}} +{{end}} + +

Parts:

+ +{{template "message-part-tree" (tuple $ .Message.PartTree)}} + +
+ +{{if .Body}} +

Reply

+
{{.Body}}
+{{else}} +

Can't preview this message part.

+ Download +{{end}} + +{{template "foot.html"}} -- cgit v1.2.3