LafayetteCollegeLibraries/spot

View on GitHub
app/views/catalog/_facets.html.erb

Summary

Maintainability
Test Coverage
<% # main container for facets/limits menu -%>
<% if general_facets? %>
<div id="facets" class="facets sidenav">

  <div class="top-panel-heading panel-heading">
    <button type="button" class="facets-toggle" data-toggle="collapse" data-target="#facet-panel-collapse">
      <span class="sr-only">Toggle facets</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>

    <h2 class='facets-heading'>
      <%= t('blacklight.search.facets.title') %>
    </h2>
  </div>

  <div id="facet-panel-collapse" class="collapse panel-group">
    <%= render_general_facet_partials %>
  </div>
</div>
<% end %>

<% # display admin facets if the user is an admin + we have some configured %>
<% if admin_facets? %>
<div id="admin-facets" class="facets sidenav">
  <div class="top-panel-heading panel-heading">
    <button type="button" class="facets-toggle" data-toggle="collapse" data-target="#facet-panel-collapse">
      <span class="sr-only">Toggle admin facets</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>

    <h2 class='facets-heading'>
      <%= t('blacklight.search.facets.admin.title') %>
    </h2>
  </div>

  <div id="admin-facet-panel-collapse" class="collapse panel-group">
    <%= render_admin_facet_partials %>
  </div>
</div>
<% end %>