vol1ura/Sat_9am_5km

View on GitHub
app/views/clubs/show.html.erb

Summary

Maintainability
Test Coverage
<% head_info :og_image, url_for(@club.logo) if @club.logo.attached? %>
<% head_info :title, @club.name %>
<% head_info :description, t('.description', club: @club.name) %>

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item">
      <%= link_to t('.main_page'), root_path %>
    </li>
    <li class="breadcrumb-item">
      <%= link_to t('.clubs'), clubs_path %>
    </li>
    <li class="breadcrumb-item active" aria-current="page"><%= @club.name %></li>
  </ol>
</nav>

<h2><%= @club.name %></h2>

<div class="row">
  <div class="col-12">
    <%= image_tag @club.logo.variant(:web), class: 'img-club', alt: @club.name if @club.logo.attached? %>
    <%= sanitized_text @club.description %>
  </div>
</div>

<ul class="list-group list-group-flush">
  <li class="list-group-item">
    <span class="badge bg-primary rounded-pill me-3"><%= @athletes.size %></span>
    <%= t '.athletes_count' %>
  </li>
  <li class="list-group-item">
    <span class="badge bg-primary rounded-pill me-3"><%= @total_results_count %></span>
    <%= t '.results_count' %>
  </li>
  <li class="list-group-item">
    <span class="badge bg-primary rounded-pill me-3"><%= @total_volunteering_count %></span>
    <%= t '.volunteering_count' %>
  </li>
  <li class="list-group-item">
    <%= link_to t('.last_week_activities'), last_week_club_path(@club) %>
  </li>
</ul>

<table class="table table-striped">
  <thead data-controller="table-head">
    <tr>
      <th><%= t '.name' %></th>
      <th>
        <span class="sort-arrow" data-action="click->table-head#toggleSort"><i class="fa fa-angle-up"></i></span>
        <%= t '.activities' %>
      </th>
      <th class="hidden-on-phone">
        <span class="sort-arrow" data-action="click->table-head#toggleSort"><i class="fa fa-angle-up"></i></span>
        <%= t '.volunteering' %>
      </th>
      <th>
        <span class="sort-arrow" data-action="click->table-head#toggleSort"><i class="fa fa-angle-up"></i></span>
        <%= t '.personal_best' %>
      </th>
    </tr>
  </thead>
  <tbody class="table-group-divider">
    <%= render partial: 'athlete', collection: @athletes, cached: true %>
  </tbody>
</table>