aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-03 19:48:28 +0100
committerSimon Ser <contact@emersion.fr>2019-12-03 19:49:04 +0100
commit8de93c50d2cf2144cfd3050cf7970a4ee9860bf4 (patch)
treebf161d7df1d4c73a7cdb2c2f365c5d0ca91f9b4c /public
parent6344806755202babab99564bee362d9e5e238185 (diff)
downloadalps-8de93c50d2cf2144cfd3050cf7970a4ee9860bf4.tar.gz
alps-8de93c50d2cf2144cfd3050cf7970a4ee9860bf4.zip
Add basic pagination to message list
References: https://todo.sr.ht/~sircmpwn/koushin/22
Diffstat (limited to 'public')
-rw-r--r--public/mailbox.html15
-rw-r--r--public/message.html8
2 files changed, 21 insertions, 2 deletions
diff --git a/public/mailbox.html b/public/mailbox.html
index e56efcb..435998c 100644
--- a/public/mailbox.html
+++ b/public/mailbox.html
@@ -20,10 +20,23 @@
<ul>
{{range .Messages}}
<li><a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}">
- {{.Envelope.Subject}}
+ {{if .Envelope.Subject}}
+ {{.Envelope.Subject}}
+ {{else}}
+ (No subject)
+ {{end}}
</a></li>
{{end}}
</ul>
+
+ <p>
+ {{if ge .PrevPage 0}}
+ <a href="?page={{.PrevPage}}">Prev</a>
+ {{end}}
+ {{if ge .NextPage 0}}
+ <a href="?page={{.NextPage}}">Next</a>
+ {{end}}
+ </p>
{{else}}
<p>Mailbox is empty.</p>
{{end}}
diff --git a/public/message.html b/public/message.html
index 2e1a308..5c18bd0 100644
--- a/public/message.html
+++ b/public/message.html
@@ -6,7 +6,13 @@
<a href="/mailbox/{{.Mailbox.Name | pathescape}}">Back</a>
</p>
-<h2>{{.Message.Envelope.Subject}}</h2>
+<h2>
+ {{if .Message.Envelope.Subject}}
+ {{.Message.Envelope.Subject}}
+ {{else}}
+ (No subject)
+ {{end}}
+</h2>
{{define "message-part-tree"}}
{{/* nested templates can't access the parent's context */}}