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 =
|
||||
Fingerprint
|
||||
|> where(fingerprint: ^fingerprint)
|
||||
|> order_by(desc: :created_at)
|
||||
|> Repo.all()
|
||||
|
||||
render(conn, "show.html",
|
||||
|
|
|
@ -21,6 +21,7 @@ defmodule PhilomenaWeb.IpProfileController do
|
|||
subnet_bans =
|
||||
Subnet
|
||||
|> where([s], fragment("? >>= ?", s.specification, ^ip))
|
||||
|> order_by(desc: :created_at)
|
||||
|> Repo.all()
|
||||
|
||||
render(conn, "show.html",
|
||||
|
|
|
@ -157,6 +157,7 @@ defmodule PhilomenaWeb.ProfileController do
|
|||
bans =
|
||||
Bans.User
|
||||
|> where(user_id: ^user.id)
|
||||
|> order_by(desc: :created_at)
|
||||
|> Repo.all()
|
||||
|
||||
render(
|
||||
|
|
|
@ -24,6 +24,6 @@ defmodule PhilomenaWeb.CurrentBanPlug do
|
|||
|
||||
ban = Bans.exists_for?(user, ip, fingerprint)
|
||||
|
||||
Conn.assign(conn, :current_ban, ban)
|
||||
Conn.assign(conn, :current_ban, ban)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue