docbrown/app/views/additional_content_boxes/_article_followable_area.html.erb
2020-02-07 08:56:16 -05:00

39 lines
2 KiB
Text

<% if followable.class.name == "Organization" && followable.nav_image.present? %>
<div class="profile-pic-wrapper wide-profile-image-wrapper">
<a href="<%= followable.path + article.decorate.internal_utm_params %>">
<img
class="wide-image"
alt="<%= followable.name %> profile image"
src="<%= cl_image_path(followable.nav_image_url,
type: "fetch",
crop: "fill",
width: 220,
quality: "auto",
flags: "progressive",
fetch_format: "auto",
sign_url: true) %>">
</a>
</div>
<% else %>
<div class="profile-pic-wrapper">
<a href="<%= followable.path + article.decorate.internal_utm_params %>"
class="<%= "partner-link" if classification == "boosted" %>"
data-details="<%= followable&.slug if classification == "boosted" %>__PROFILE">
<img class="profile-image"
src="<%= ProfileImage.new(followable).get(width: 200) %>"
alt="<%= followable.name %> profile image"
loading="lazy"
data-details="<%= followable&.slug if classification == "boosted" %>__PROFILE"
style="border: 4px solid <%= followable.bg_color_hex %>" /></a>
</div>
<div class="org-name">
<a href="<%= followable.path + article.decorate.internal_utm_params %>"
class="<%= "partner-link" if classification == "boosted" %>"
data-details="<%= followable&.slug if classification == "boosted" %>__PROFILE"><%= followable.name %></a>
<%= render "shared/pro_checkmark" if followable.pro? %>
</div>
<% end %>
<button class="cta follow-action-button user-profile-follow-button <%= "partner-link" if classification == "boosted" %>"
style="color:<%= user_colors(followable)[:text] %>;background-color:<%= user_colors(followable)[:bg] %>"
data-info='{"id":<%= followable.id %>,"className":"<%= followable.class.name %>"}'>&nbsp;
</button>