mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 12:37:58 +01:00
15 lines
347 B
Elixir
15 lines
347 B
Elixir
|
defmodule PhilomenaWeb.Admin.UserBanView do
|
||
|
use PhilomenaWeb, :view
|
||
|
|
||
|
import PhilomenaWeb.ProfileView, only: [user_abbrv: 2]
|
||
|
|
||
|
defp 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
|
||
|
end
|