mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
fix misc pagination issues
This commit is contained in:
parent
8f7a9b7c50
commit
e4e20033e7
3 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,7 @@ defmodule PhilomenaWeb.Admin.Badge.UserController do
|
||||||
|> join(:inner, [u], _ in assoc(u, :awards))
|
|> join(:inner, [u], _ in assoc(u, :awards))
|
||||||
|> where([_u, a], a.badge_id == ^badge.id)
|
|> where([_u, a], a.badge_id == ^badge.id)
|
||||||
|> order_by([u, _a], asc: u.name)
|
|> order_by([u, _a], asc: u.name)
|
||||||
|> Repo.paginate(conn.assigns.pagination)
|
|> Repo.paginate(conn.assigns.scrivener)
|
||||||
|
|
||||||
render(conn, "index.html", title: "Users with badge #{badge.title}", users: users)
|
render(conn, "index.html", title: "Users with badge #{badge.title}", users: users)
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ defmodule PhilomenaWeb.DuplicateReportController do
|
||||||
|> where([d], d.state in ^states)
|
|> where([d], d.state in ^states)
|
||||||
|> preload([:user, :modifier, image: [:user, :tags], duplicate_of_image: [:user, :tags]])
|
|> preload([:user, :modifier, image: [:user, :tags], duplicate_of_image: [:user, :tags]])
|
||||||
|> order_by(desc: :created_at)
|
|> order_by(desc: :created_at)
|
||||||
|> Repo.paginate(conn.assigns.pagination)
|
|> Repo.paginate(conn.assigns.scrivener)
|
||||||
|
|
||||||
render(conn, "index.html",
|
render(conn, "index.html",
|
||||||
title: "Duplicate Reports",
|
title: "Duplicate Reports",
|
||||||
|
|
|
@ -13,6 +13,7 @@ defmodule PhilomenaWeb.ReportController do
|
||||||
reports =
|
reports =
|
||||||
Report
|
Report
|
||||||
|> where(user_id: ^user.id)
|
|> where(user_id: ^user.id)
|
||||||
|
|> order_by(desc: :created_at)
|
||||||
|> Repo.paginate(conn.assigns.scrivener)
|
|> Repo.paginate(conn.assigns.scrivener)
|
||||||
|
|
||||||
polymorphic =
|
polymorphic =
|
||||||
|
|
Loading…
Reference in a new issue