From 2d86413876411339a27a09a025e0e77bd22a04ca Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 13 May 2020 15:02:02 -0400 Subject: [PATCH] mailbox: show unseen message count in page title --- plugins/base/routes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 780cffb..3b47668 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -142,6 +142,10 @@ func handleGetMailbox(ctx *alps.Context) error { title = "Inbox" } + if mbox.Unseen > 0 { + title = fmt.Sprintf("(%d) %s", mbox.Unseen, title) + } + return ctx.Render(http.StatusOK, "mailbox.html", &MailboxRenderData{ BaseRenderData: *alps.NewBaseRenderData(ctx).WithTitle(title), Mailbox: mbox,