mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-23 01:18:00 +01:00
23 lines
468 B
Elixir
23 lines
468 B
Elixir
defmodule PhilomenaWeb.Admin.BanView do
|
|
alias PhilomenaWeb.ProfileView
|
|
|
|
def user_abbrv(user),
|
|
do: ProfileView.user_abbrv(user)
|
|
|
|
def ban_row_class(%{valid_until: until, enabled: enabled}) do
|
|
now = DateTime.utc_now()
|
|
|
|
case enabled and DateTime.diff(until, now) > 0 do
|
|
true -> "success"
|
|
_false -> "danger"
|
|
end
|
|
end
|
|
|
|
def page_params(params) do
|
|
case params["q"] do
|
|
nil -> []
|
|
"" -> []
|
|
q -> [q: q]
|
|
end
|
|
end
|
|
end
|