philomena/lib/philomena_web/views/admin/fingerprint_ban_view.ex

15 lines
354 B
Elixir
Raw Normal View History

2019-12-13 20:06:08 +01:00
defmodule PhilomenaWeb.Admin.FingerprintBanView 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