calculate pagination info correctly

This commit is contained in:
byte[] 2019-12-12 17:15:59 -05:00
parent aa4af5a2e6
commit 47cd24e506
2 changed files with 4 additions and 2 deletions

View file

@ -65,6 +65,8 @@ defimpl Canada.Can, for: [Atom, Philomena.Users.User] do
def can?(%User{role: "moderator"}, :index, DnpEntry), do: true
def can?(%User{role: "moderator"}, :edit, %DnpEntry{}), do: true
def can?(%User{role: "moderator"}, :update, %DnpEntry{}), do: true
def can?(%User{role: "moderator"}, :show_reason, %DnpEntry{}), do: true
def can?(%User{role: "moderator"}, :show_feedback, %DnpEntry{}), do: true
#
# Assistants can...

View file

@ -3,7 +3,7 @@
=> pluralize("result", "results", @page.total_entries)
strong
=> max(((@page.page_number - 1) * @page.page_size) - 1, 1)
=> max(((@page.page_number - 1) * @page.page_size), 0) + 1
' -
=> min(@page.page_number * @page.page_size, @page.total_entries)
' of
@ -13,4 +13,4 @@
' total
- else
' No results found
' No results found