noesya/osuny

View on GitHub
app/views/admin/communication/blocks/templates/pages/layouts/_cards.html.erb

Summary

Maintainability
Test Coverage
<div class="cards">
  <% block.template.selected_pages.each do |page|
    next if page.nil?
    page_l10n = page.localization_for(block.language)
    %>
    <article class="card">
      <h<%= block.heading_rank_children %>>
        <%= link_to page, page_l10n.current_permalink_url_in_website(@website) %>
      </h<%= block.heading_rank_children %>>
      <% if block.template.option_summary %>
        <p><%= page_l10n.summary %></p>
      <% end %>
      <p class="more meta" aria-hidden="true">
        <%= t 'admin.communication.blocks.templates.pages.layouts.cards.more' %>
      </p>
      <% if block.template.option_image %>
        <div class="media" itemprop="image">
          <% if page_l10n.featured_image.attached? %>
            <%= kamifusen_tag page_l10n.featured_image %>
          <% end %>
        </div>
      <% end %>
    </article>
  <% end %>
</div>