philomena/lib/philomena_web/views/source_change_view.ex
2020-01-10 23:20:19 -05:00

15 lines
384 B
Elixir

defmodule PhilomenaWeb.SourceChangeView do
use PhilomenaWeb, :view
def staff?(source_change),
do:
not is_nil(source_change.user) and not Philomena.Attribution.anonymous?(source_change) and
source_change.user.role != "user"
def user_column_class(source_change) do
case staff?(source_change) do
true -> "success"
false -> nil
end
end
end