From 5f266319a3f7587dcd7c5f578224032da395eae7 Mon Sep 17 00:00:00 2001 From: logan <60271007+1pav@users.noreply.github.com> Date: Thu, 9 Jul 2020 01:24:54 +0200 Subject: Add option to change the number of entries per page (fixes #40) --- ui/unread_entries.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/unread_entries.go') diff --git a/ui/unread_entries.go b/ui/unread_entries.go index c49fc30b..e01c941f 100644 --- a/ui/unread_entries.go +++ b/ui/unread_entries.go @@ -43,7 +43,7 @@ func (h *handler) showUnreadPage(w http.ResponseWriter, r *http.Request) { builder.WithOrder(model.DefaultSortingOrder) builder.WithDirection(user.EntryDirection) builder.WithOffset(offset) - builder.WithLimit(nbItemsPerPage) + builder.WithLimit(user.EntriesPerPage) entries, err := builder.GetEntries() if err != nil { html.ServerError(w, r, err) @@ -51,7 +51,7 @@ func (h *handler) showUnreadPage(w http.ResponseWriter, r *http.Request) { } view.Set("entries", entries) - view.Set("pagination", getPagination(route.Path(h.router, "unread"), countUnread, offset)) + view.Set("pagination", getPagination(route.Path(h.router, "unread"), countUnread, offset, user.EntriesPerPage)) view.Set("menu", "unread") view.Set("user", user) view.Set("countUnread", countUnread) -- cgit v1.2.3