psu-libraries/psulib_blacklight

View on GitHub
app/views/browse/_titles.html.erb

Summary

Maintainability
Test Coverage
<%= render Browse::Controls.new(
      navigator: Browse::FacetNavigation.new(list: title_list)
    ) %>

<table class="table table-striped my-3">
  <thead>
    <tr>
      <th scope="col">Title</th>
      <th scope="col">Count</th>
    </tr>
  </thead>
  <tbody>
    <% title_list.entries.map do |item| %>
      <tr>
        <td><%= link_to item.value, search_catalog_path('f[title_sort][]' => item.value) %></td>
        <td><%= item.hits %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= render Browse::Controls.new(
      navigator: Browse::FacetNavigation.new(list: title_list)
    ) %>