docbrown/app/views/articles/_bottom_content.html.erb
Ben Halpern ec7adf56fe
Allow admins to set cover image height configs (#19936)
* Initial basic work

* Bulk of related work, including find/replace on the inputs

* Adjust some tests

* Adjust some specs

* Fix a few more tests

* Clean up tests

* Adjust tests

* Test fiddle

* Adjust crop back to be a param

* Update tests

* Set proper defaults

* Fix some styling

* Adjust enrichment logic and tests

* Adjust form JS

* Update test snapshot

* Clean up formatting

* Fix spec name

* Adjust some css and defaults

* Adjust translation for image provider options

* Switch from fill to fill-down

* Proper fallback image

* Fix tests

* Update app/services/images/optimizer.rb

Co-authored-by: Mac Siri <mac@forem.com>

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-08-21 13:25:16 -04:00

24 lines
1.3 KiB
Text

<% if articles && articles.any? %>
<section class="crayons-card crayons-card--secondary text-padding mb-4 print-hidden" id="bottom-content-read-next">
<h2 class="crayons-subtitle-1"><%= t("views.articles.read_next") %></h2>
<% articles.each do |article| %>
<a href="<%= article.path %>" data-preload-image="<%= cloud_cover_url(article.main_image) %>" class="crayons-link mt-6 block">
<div class="flex items-center">
<span class="crayons-avatar crayons-avatar--xl m:crayons-avatar--2xl mr-4 shrink-0">
<% if article.cached_user.profile_image_url %>
<%= optimized_image_tag(article.cached_user.profile_image_url,
optimizer_options: { crop: "crop", width: 100, height: 100 },
image_options: { loading: "lazy", alt: "#{article.cached_user.username} profile image", class: "crayons-avatar__image" }) %>
<% end %>
</span>
<div>
<h3 class="fs-xl mb-0 lh-tight"><%= article.title %></h3>
<p class="opacity-75 pt-1">
<%= article.cached_user.name %> - <time datetime="<%= article.published_timestamp %>"><%= article.readable_publish_date %></time>
</p>
</div>
</div>
</a>
<% end %>
</section>
<% end %>