aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-17 15:01:15 +0100
committerSimon Ser <contact@emersion.fr>2019-12-17 15:01:15 +0100
commitca3672df2ad75cbb866b08ca79320a75e30a55ce (patch)
tree72bd0406d61d5e64e36c90a79c3e6e511c490fd8 /plugins/base
parentd8a875a5f74f90c2ca52c61e72ddb88f78d97277 (diff)
downloadalps-ca3672df2ad75cbb866b08ca79320a75e30a55ce.tar.gz
alps-ca3672df2ad75cbb866b08ca79320a75e30a55ce.zip
Add RenderData interface
This allows Go plugins to easily inject global data.
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/routes.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index fe3e946..f3f196a 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -116,12 +116,12 @@ func handleGetMailbox(ectx echo.Context) error {
return ctx.Render(http.StatusOK, "mailbox.html", &MailboxRenderData{
BaseRenderData: *koushin.NewBaseRenderData(ctx),
- Mailbox: mbox,
- Mailboxes: mailboxes,
- Messages: msgs,
- PrevPage: prevPage,
- NextPage: nextPage,
- Query: query,
+ Mailbox: mbox,
+ Mailboxes: mailboxes,
+ Messages: msgs,
+ PrevPage: prevPage,
+ NextPage: nextPage,
+ Query: query,
})
}
@@ -239,14 +239,14 @@ func handleGetPart(ctx *koushin.Context, raw bool) error {
}
return ctx.Render(http.StatusOK, "message.html", &MessageRenderData{
- BaseRenderData: *koushin.NewBaseRenderData(ctx),
- Mailboxes: mailboxes,
- Mailbox: mbox,
- Message: msg,
- Body: body,
- PartPath: partPathString,
- MailboxPage: int(mbox.Messages-msg.SeqNum) / messagesPerPage,
- Flags: flags,
+ BaseRenderData: *koushin.NewBaseRenderData(ctx),
+ Mailboxes: mailboxes,
+ Mailbox: mbox,
+ Message: msg,
+ Body: body,
+ PartPath: partPathString,
+ MailboxPage: int(mbox.Messages-msg.SeqNum) / messagesPerPage,
+ Flags: flags,
})
}
@@ -354,7 +354,7 @@ func handleCompose(ectx echo.Context) error {
return ctx.Render(http.StatusOK, "compose.html", &ComposeRenderData{
BaseRenderData: *koushin.NewBaseRenderData(ctx),
- Message: &msg,
+ Message: &msg,
})
}