diff options
author | Simon Ser <contact@emersion.fr> | 2019-12-17 15:01:15 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-12-17 15:01:15 +0100 |
commit | ca3672df2ad75cbb866b08ca79320a75e30a55ce (patch) | |
tree | 72bd0406d61d5e64e36c90a79c3e6e511c490fd8 /plugins | |
parent | d8a875a5f74f90c2ca52c61e72ddb88f78d97277 (diff) | |
download | alps-ca3672df2ad75cbb866b08ca79320a75e30a55ce.tar.gz alps-ca3672df2ad75cbb866b08ca79320a75e30a55ce.zip |
Add RenderData interface
This allows Go plugins to easily inject global data.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/base/routes.go | 30 |
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, }) } |