correct avatar class for users with avatar

This commit is contained in:
byte[] 2019-11-28 12:19:27 -05:00
parent fbfa572a1e
commit da09d45c7f

View file

@ -34,8 +34,13 @@ defmodule PhilomenaWeb.UserAttributionView do
do: anonymous_avatar(object, class)
def user_avatar(%{user: %{avatar: nil}} = object, class),
do: anonymous_avatar(object, class)
def user_avatar(%{user: %{avatar: avatar}}, class),
do: img_tag(avatar_url_root() <> "/" <> avatar, class: class)
def user_avatar(%{user: %{avatar: avatar}}, class) do
class = Enum.join(["image-constrained", class], " ")
content_tag :div, [class: class] do
img_tag(avatar_url_root() <> "/" <> avatar)
end
end
def user_labels(%{user: user}) do
[]