osunyorg/admin

View on GitHub
app/views/showcase/home/_list.html.erb

Summary

Maintainability
Test Coverage
<p class="text-end">
  <%= @websites.total_count %>
  <%= Communication::Website.model_name.human(count: @websites.total_count).downcase %>
</p>

<div class="row">
  <% @websites.each do |website| %>
    <div class="col-lg-6">
      <article class="mb-5 pb-5">
        <% if website.screenshot.attached? %>
          <%= link_to website.url, target: :_blank, class: 'no-icon' do %>
            <%= kamifusen_tag website.screenshot, 
                              class: 'img-fluid rounded mb-3' %>
          <% end %>
        <% end %>
        <div class="row">
          <div class="col-lg-10">
            <h2 class="h4"><%= website.original_localization.to_s %></h2>
            <div class="small mb-1">
              <i class="bi bi-compass-fill me-1"></i>
              <%= contact_link website.url, :website %>
            </div>
            <div class="small mb-1">
              <i class="bi bi-github me-1"></i>
              <%= contact_link website.repository_url, :github %>
            </div>
            <% website.showcase_tags.each do |tag| %>
              <%= link_to tag, 
                          showcase_tag_path(tag.slug), 
                          class: 'btn btn-sm btn-outline-light text-dark rounded-pill' %>
            <% end %>  
          </div>
          <% if website.university.logo.attached? %>
            <div class="col-3 col-lg-2">
              <div class="ratio ratio-1x1 mb-3">
                <%= image_tag website.university.logo, 
                              class: 'img-fluid p-3',
                              style: 'filter: saturate(0)' %>
              </div>
            </div>
          <% end %>
        </div>
      </article>
    </div>
  <% end %>
</div>
<%= paginate @websites %>