diff options
author | 2017-11-21 18:37:08 -0800 | |
---|---|---|
committer | 2017-11-21 18:37:08 -0800 | |
commit | 1bc43ec2bc2282d9e18ca622444d45f09c1b6378 (patch) | |
tree | acadc7a1bbbc508c0beee3bdb48879820eb1c2f0 /server/ui/controller/history.go | |
parent | 02ff7b4bcf2b2c691e55ae61fe97bfd9ae37658e (diff) | |
download | v2-1bc43ec2bc2282d9e18ca622444d45f09c1b6378.tar.gz v2-1bc43ec2bc2282d9e18ca622444d45f09c1b6378.tar.zst v2-1bc43ec2bc2282d9e18ca622444d45f09c1b6378.zip |
Improve Context to be more idiomatic
Diffstat (limited to 'server/ui/controller/history.go')
-rw-r--r-- | server/ui/controller/history.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/ui/controller/history.go b/server/ui/controller/history.go index dff78be1..100b12f5 100644 --- a/server/ui/controller/history.go +++ b/server/ui/controller/history.go @@ -11,7 +11,7 @@ import ( // ShowHistoryPage renders the page with all read entries. func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, response *core.Response) { - user := ctx.GetLoggedUser() + user := ctx.LoggedUser() offset := request.QueryIntegerParam("offset", 0) args, err := c.getCommonTemplateArgs(ctx) @@ -42,14 +42,14 @@ func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, r response.HTML().Render("history", args.Merge(tplParams{ "entries": entries, "total": count, - "pagination": c.getPagination(ctx.GetRoute("history"), count, offset), + "pagination": c.getPagination(ctx.Route("history"), count, offset), "menu": "history", })) } // FlushHistory changes all "read" items to "removed". func (c *Controller) FlushHistory(ctx *core.Context, request *core.Request, response *core.Response) { - user := ctx.GetLoggedUser() + user := ctx.LoggedUser() err := c.store.FlushHistory(user.ID) if err != nil { @@ -57,5 +57,5 @@ func (c *Controller) FlushHistory(ctx *core.Context, request *core.Request, resp return } - response.Redirect(ctx.GetRoute("history")) + response.Redirect(ctx.Route("history")) } |