mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-31 19:36:44 +01:00
calculate pagination info correctly
This commit is contained in:
parent
aa4af5a2e6
commit
47cd24e506
2 changed files with 4 additions and 2 deletions
|
@ -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...
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue