mailbox: show unseen message count in page title

This commit is contained in:
Drew DeVault 2020-05-13 15:02:02 -04:00 committed by Simon Ser
parent 7ba4275471
commit 2d86413876
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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,