Skip to content

Commit

Permalink
Merge pull request #190 from ukparliament/development
Browse files Browse the repository at this point in the history
Development merge
  • Loading branch information
j-corry authored Nov 11, 2024
2 parents 4ec41ae + 274aada commit 6f09d20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/search/_hierarchy_layer.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if id %>
<% if id && @type_facets[id] %>
<div class="grid-row">
<span class="facet-toggle toggle-<%= parent_id %> <%= 'collapse' if (tier > 1 && !@expanded_types.include?(parent_id.to_s)) %>" style="margin-left: <%= (tier - 1) * 0 %>px;">
<% if @hierarchy_data.dig(id, :children).any? %>
Expand Down
16 changes: 10 additions & 6 deletions app/views/search/results/facets/_session_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
</div>
<div class="facets">
<% SolrSearch.sessions[0..4].each do |session| %>
<div>
<%= 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") %>
</div>
<% unless facet_data.dig("session_#{session}", "count") == 0 %>
<div>
<%= 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") %>
</div>
<% end %>
<% end %>
<% unless SolrSearch.sessions[5..].blank? %>
<details>
<summary>More</summary>
<% SolrSearch.sessions[5..].each do |session| %>
<div>
<%= 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") %>
</div>
<% unless facet_data.dig("session_#{session}", "count") == 0 %>
<div>
<%= 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") %>
</div>
<% end %>
<% end %>
</details>
<% end %>
Expand Down

0 comments on commit 6f09d20

Please sign in to comment.