From da09d45c7f8ce8c1f77565f33ec3f800b6a51a74 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Thu, 28 Nov 2019 12:19:27 -0500 Subject: [PATCH] correct avatar class for users with avatar --- lib/philomena_web/views/user_attribution_view.ex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/views/user_attribution_view.ex b/lib/philomena_web/views/user_attribution_view.ex index b9f9c137..83f1cf71 100644 --- a/lib/philomena_web/views/user_attribution_view.ex +++ b/lib/philomena_web/views/user_attribution_view.ex @@ -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 []