philomena/lib/philomena_web/views/admin/subnet_ban_view.ex
2019-12-13 13:50:35 -05:00

14 lines
349 B
Elixir

defmodule PhilomenaWeb.Admin.SubnetBanView 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