From 4ab5fb7f65fe8d8f0b291dbead9f0134a28eaba2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 3 Dec 2019 20:06:43 +0100 Subject: Make message view's Back link set the mailbox page This allows to go back and forth between the mailbox view and the message view. References: https://todo.sr.ht/~sircmpwn/koushin/22 --- server.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'server.go') diff --git a/server.go b/server.go index 93da487..021ecff 100644 --- a/server.go +++ b/server.go @@ -203,10 +203,11 @@ func handleGetPart(ctx *context, raw bool) error { } return ctx.Render(http.StatusOK, "message.html", map[string]interface{}{ - "Mailbox": mbox, - "Message": msg, - "Body": body, - "PartPath": partPathString, + "Mailbox": mbox, + "Message": msg, + "Body": body, + "PartPath": partPathString, + "MailboxPage": (mbox.Messages - msg.SeqNum) / messagesPerPage, }) } -- cgit v1.2.3-59-g8ed1b