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

18 lines
403 B
Elixir
Raw Permalink Normal View History

2019-12-13 20:06:08 +01:00
defmodule PhilomenaWeb.Admin.FingerprintBanView do
use PhilomenaWeb, :view
alias PhilomenaWeb.ProfileView
defp user_abbrv(conn, user),
do: ProfileView.user_abbrv(conn, user)
2019-12-13 20:06:08 +01:00
defp ban_row_class(%{valid_until: until, enabled: enabled}) do
now = DateTime.utc_now()
case enabled and DateTime.diff(until, now) > 0 do
2020-01-11 05:20:19 +01:00
true -> "success"
2019-12-13 20:06:08 +01:00
_false -> "danger"
end
end
end