aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/history_entries.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-11-11 11:28:29 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-11-11 11:29:12 -0800
commit5a69a61d4841a35d7ddcb761a688db8c688314d6 (patch)
treeb807ee1da5b0705e7649f70742d8198f351c1224 /ui/history_entries.go
parent0925899cee9362cf09e982487bd480e2b09041f4 (diff)
Move UI middlewares and routes to ui package
Diffstat (limited to 'ui/history_entries.go')
-rw-r--r--ui/history_entries.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/ui/history_entries.go b/ui/history_entries.go
index 8449240..131879c 100644
--- a/ui/history_entries.go
+++ b/ui/history_entries.go
@@ -15,16 +15,15 @@ import (
"miniflux.app/ui/view"
)
-// ShowHistoryPage renders the page with all read entries.
-func (c *Controller) ShowHistoryPage(w http.ResponseWriter, r *http.Request) {
- user, err := c.store.UserByID(request.UserID(r))
+func (h *handler) showHistoryPage(w http.ResponseWriter, r *http.Request) {
+ user, err := h.store.UserByID(request.UserID(r))
if err != nil {
html.ServerError(w, r, err)
return
}
offset := request.QueryIntParam(r, "offset", 0)
- builder := c.store.NewEntryQueryBuilder(user.ID)
+ builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithStatus(model.EntryStatusRead)
builder.WithOrder(model.DefaultSortingOrder)
builder.WithDirection(user.EntryDirection)
@@ -43,16 +42,16 @@ func (c *Controller) ShowHistoryPage(w http.ResponseWriter, r *http.Request) {
return
}
- sess := session.New(c.store, request.SessionID(r))
- view := view.New(c.tpl, r, sess)
+ sess := session.New(h.store, request.SessionID(r))
+ view := view.New(h.tpl, r, sess)
view.Set("entries", entries)
view.Set("total", count)
- view.Set("pagination", c.getPagination(route.Path(c.router, "history"), count, offset))
+ view.Set("pagination", getPagination(route.Path(h.router, "history"), count, offset))
view.Set("menu", "history")
view.Set("user", user)
- view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
- view.Set("countErrorFeeds", c.store.CountErrorFeeds(user.ID))
- view.Set("hasSaveEntry", c.store.HasSaveEntry(user.ID))
+ view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
+ view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
+ view.Set("hasSaveEntry", h.store.HasSaveEntry(user.ID))
html.OK(w, r, view.Render("history_entries"))
}