diff --git a/app/views/search/_hierarchy_layer.html.erb b/app/views/search/_hierarchy_layer.html.erb index ae200f4..bcc0885 100644 --- a/app/views/search/_hierarchy_layer.html.erb +++ b/app/views/search/_hierarchy_layer.html.erb @@ -1,4 +1,4 @@ -<% if id %> +<% if id && @type_facets[id] %>
<% if @hierarchy_data.dig(id, :children).any? %> diff --git a/app/views/search/results/facets/_session_facet.html.erb b/app/views/search/results/facets/_session_facet.html.erb index b426e26..f5f59ca 100644 --- a/app/views/search/results/facets/_session_facet.html.erb +++ b/app/views/search/results/facets/_session_facet.html.erb @@ -5,18 +5,22 @@
<% SolrSearch.sessions[0..4].each do |session| %> -
- <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{number_to_delimited(facet_data.dig("session_#{session}", "count"), separator: ",")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> -
+ <% unless facet_data.dig("session_#{session}", "count") == 0 %> +
+ <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{number_to_delimited(facet_data.dig("session_#{session}", "count"), separator: ",")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> +
+ <% end %> <% end %> <% unless SolrSearch.sessions[5..].blank? %>
More <% SolrSearch.sessions[5..].each do |session| %> -
- <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{number_to_delimited(facet_data.dig("session_#{session}", "count"), separator: ",")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> -
+ <% unless facet_data.dig("session_#{session}", "count") == 0 %> +
+ <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{number_to_delimited(facet_data.dig("session_#{session}", "count"), separator: ",")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> +
+ <% end %> <% end %>
<% end %>