app/views/dashboard/_table.html.erb

Summary

Maintainability
Test Coverage
<table class="table table-hover dashboard-table table-responsive">
  <thead>
    <tr>
      <th><%= t("txt.views.dashboard.value") %><%= sorting_controls_for(:value) %></th>
      <% unless @items.first.class == Iqvoc::Collection.base_class %>
        <th><%= t("txt.views.dashboard.follow_up") %><%= sorting_controls_for(:follow_up) %></th>
      <% end %>
      <th><%= t("txt.views.dashboard.updated_at") %><%= sorting_controls_for(:updated_at) %></th>
      <th><%= t("txt.views.dashboard.state") %><%= sorting_controls_for(:state) %></th>
      <%- if params[:check_consistency] == "1" -%>
        <th><%= t("txt.views.dashboard.consistent") %>?</th>
      <%- else -%>
        <th><%= link_to t("txt.views.dashboard.check_consistency"), sorting_params.merge(:check_consistency => 1) %></th>
      <%- end -%>
    </tr>
  </thead>
  <tbody>
    <% @items.each do |item| -%>
      <tr class="highlightable dashboard-table-item" data-url="<%= link_to_dashboard_item(item) %>">
        <td class="text-nowrap">
          <%= render item.class.edit_link_partial_name, :item => item %>
          <a href="<%= dashboard_glance_path(type: item.class, origin: item.origin, published: item.published? ? 1 : 0) %>" class="dashboard-glance-link"><i class="fa fa-search-plus"></i></a>
        </td>
        <% unless item.class == Iqvoc::Collection.base_class %>
          <td class="<%= 'dashboard-activated-follow-up-column' if item.follow_up.present? %>">
            <%= l(item.follow_up) if item.follow_up.present? %>
          </td>
        <% end %>
        <td class="text-nowrap">
          <%= l(item.updated_at, :format => :short) %>
        </td>
        <td>
          <span class="badge <%= !item.published? || item.in_review? ? 'badge-danger' : 'badge-secondary' %> dashboard-table-item-state"><%= item.state %></span>
        </td>
        <td>
        <%- if params[:check_consistency] == "1" -%>
          <%= consistency_status(item) %>
        <%- end -%>
        </td>
      </tr>
    <% end -%>
  </tbody>
</table>

<%= paginate @items %>