noesya/osuny

View on GitHub
app/views/admin/communication/blocks/templates/organizations/_show.html.erb

Summary

Maintainability
Test Coverage
<div class="<%= block_html_class(block) %>">
  <div class="container">
    <div class="block-content">
      <%= render 'admin/communication/blocks/partials/top', block: block %>

      <% if block.template.layout == "grid" %>
        <div class="organizations grid">
      <% else # Map %>
        <% content_for :leaflet_required, true %>
        <div class="map" data-marker-icon="<%= image_path 'map-marker.svg' %>">
      <% end %>
        <% block.template.selected_elements.each do |element| %>
          <% next if element.best_name.blank? %>
          <article  class="organization"
                    data-latitude="<%= element.organization&.latitude %>"
                    data-longitude="<%= element.organization&.longitude %>">
            <p class="organization-title">
              <% if block.template.option_link && element.best_url %>
                <a href="<%= element.best_url %>" target="_blank">
              <% end %>
              <%= element.best_name %>
              <% if block.template.option_link && element.best_url %>
                </a>
              <% end %>
            </p>
            <div class="media">
              <% if element.best_logo_blob %>
                <%= kamifusen_tag element.best_logo_blob, width: 600 %>
              <% end %>
            </div>
          </article>
        <% end %>
      </div>
    </div>
  </div>
</div>