mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
display bans in sorted order (fixes philomena-dev/philomena#66)
This commit is contained in:
parent
e058a212e7
commit
37adb661fb
4 changed files with 4 additions and 1 deletions
|
@ -19,6 +19,7 @@ defmodule PhilomenaWeb.FingerprintProfileController do
|
||||||
fp_bans =
|
fp_bans =
|
||||||
Fingerprint
|
Fingerprint
|
||||||
|> where(fingerprint: ^fingerprint)
|
|> where(fingerprint: ^fingerprint)
|
||||||
|
|> order_by(desc: :created_at)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
|
||||||
render(conn, "show.html",
|
render(conn, "show.html",
|
||||||
|
|
|
@ -21,6 +21,7 @@ defmodule PhilomenaWeb.IpProfileController do
|
||||||
subnet_bans =
|
subnet_bans =
|
||||||
Subnet
|
Subnet
|
||||||
|> where([s], fragment("? >>= ?", s.specification, ^ip))
|
|> where([s], fragment("? >>= ?", s.specification, ^ip))
|
||||||
|
|> order_by(desc: :created_at)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
|
||||||
render(conn, "show.html",
|
render(conn, "show.html",
|
||||||
|
|
|
@ -157,6 +157,7 @@ defmodule PhilomenaWeb.ProfileController do
|
||||||
bans =
|
bans =
|
||||||
Bans.User
|
Bans.User
|
||||||
|> where(user_id: ^user.id)
|
|> where(user_id: ^user.id)
|
||||||
|
|> order_by(desc: :created_at)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
|
||||||
render(
|
render(
|
||||||
|
|
Loading…
Reference in a new issue