2019-12-04 23:56:13 +01:00
|
|
|
defmodule PhilomenaWeb.SourceChangeView do
|
|
|
|
use PhilomenaWeb, :view
|
2019-12-13 20:56:52 +01:00
|
|
|
|
|
|
|
def staff?(source_change),
|
2020-01-11 05:20:19 +01:00
|
|
|
do:
|
|
|
|
not is_nil(source_change.user) and not Philomena.Attribution.anonymous?(source_change) and
|
2020-07-13 19:09:30 +02:00
|
|
|
source_change.user.role != "user" and not source_change.user.hide_default_role
|
2019-12-13 20:56:52 +01:00
|
|
|
|
|
|
|
def user_column_class(source_change) do
|
|
|
|
case staff?(source_change) do
|
2020-01-11 05:20:19 +01:00
|
|
|
true -> "success"
|
2019-12-13 20:56:52 +01:00
|
|
|
false -> nil
|
|
|
|
end
|
|
|
|
end
|
2019-12-04 23:56:13 +01:00
|
|
|
end
|