psu-libraries/psulib_blacklight

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

Summary

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

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

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