aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-05-13 10:46:35 -0400
committerSimon Ser <contact@emersion.fr>2020-05-13 17:00:47 +0200
commit3d1f278fae716b37fa6a4b8bdf52d21dba371cc5 (patch)
treeea5080e7bd7fd6ef0710e31b8350516369a58d53 /plugins
parent1cf95af41ea24ab76cba8a0761d349b65c08c294 (diff)
downloadalps-3d1f278fae716b37fa6a4b8bdf52d21dba371cc5.tar.gz
alps-3d1f278fae716b37fa6a4b8bdf52d21dba371cc5.zip
Use context-appropriate title for mbox/msg view
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/routes.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index 70764e6..2d4cb8c 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -136,7 +136,7 @@ func handleGetMailbox(ctx *alps.Context) error {
}
return ctx.Render(http.StatusOK, "mailbox.html", &MailboxRenderData{
- BaseRenderData: *alps.NewBaseRenderData(ctx),
+ BaseRenderData: *alps.NewBaseRenderData(ctx).WithTitle(mbox.Name),
Mailbox: mbox,
Mailboxes: mailboxes,
Messages: msgs,
@@ -271,14 +271,15 @@ func handleGetPart(ctx *alps.Context, raw bool) error {
}
return ctx.Render(http.StatusOK, "message.html", &MessageRenderData{
- BaseRenderData: *alps.NewBaseRenderData(ctx),
- Mailboxes: mailboxes,
- Mailbox: mbox,
- Message: msg,
- Part: msg.PartByPath(partPath),
- View: view,
- MailboxPage: int(mbox.Messages-msg.SeqNum) / messagesPerPage,
- Flags: flags,
+ BaseRenderData: *alps.NewBaseRenderData(ctx).
+ WithTitle(msg.Envelope.Subject),
+ Mailboxes: mailboxes,
+ Mailbox: mbox,
+ Message: msg,
+ Part: msg.PartByPath(partPath),
+ View: view,
+ MailboxPage: int(mbox.Messages-msg.SeqNum) / messagesPerPage,
+ Flags: flags,
})
}