diff --git a/app/helpers/meta_helper.rb b/app/helpers/meta_helper.rb deleted file mode 100644 index eb12382..0000000 --- a/app/helpers/meta_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module MetaHelper -end diff --git a/app/views/search/_filter_section.html.erb b/app/views/search/_filter_section.html.erb index c6c6d5c..a94a1d3 100644 --- a/app/views/search/_filter_section.html.erb +++ b/app/views/search/_filter_section.html.erb @@ -5,7 +5,7 @@ <% facet_field[:facets][0..4].each do |facet| %>
- <%= link_to_if(!request.params.dig(:filter, facet_field[:field_name])&.include?(facet["val"].to_s), "#{object_display_name({ value: facet["val"], field_name: facet_field[:field_name] }, singular: false)} (#{facet["count"]})", url_for(apply_filter_url(request.params, facet_field[:field_name], facet["val"])), class: "menu-link modifiable-link") %> + <%= link_to_if(!request.params.dig(:filter, facet_field[:field_name])&.include?(facet["val"].to_s), "#{object_display_name({ value: facet["val"], field_name: facet_field[:field_name] }, singular: false)} (#{number_to_delimited(facet["count"], separator: ",")})", url_for(apply_filter_url(request.params, facet_field[:field_name], facet["val"])), class: "menu-link modifiable-link") %>
<% end %> <% unless facet_field[:facets][5..].blank? %> @@ -13,7 +13,7 @@ More <% facet_field[:facets][5...].each do |facet| %>
- <%= link_to_if(!request.params.dig(:filter, facet_field[:field_name])&.include?(facet["val"].to_s), "#{object_display_name({ value: facet["val"], field_name: facet_field[:field_name] }, singular: false)} (#{facet["count"]})", url_for(apply_filter_url(request.params, facet_field[:field_name], facet["val"])), class: "menu-link modifiable-link") %> + <%= link_to_if(!request.params.dig(:filter, facet_field[:field_name])&.include?(facet["val"].to_s), "#{object_display_name({ value: facet["val"], field_name: facet_field[:field_name] }, singular: false)} (#{number_to_delimited(facet["count"], separator: ",")})", url_for(apply_filter_url(request.params, facet_field[:field_name], facet["val"])), class: "menu-link modifiable-link") %>
<% end %> diff --git a/app/views/search/_hierarchy_layer.html.erb b/app/views/search/_hierarchy_layer.html.erb index 98ae776..ae200f4 100644 --- a/app/views/search/_hierarchy_layer.html.erb +++ b/app/views/search/_hierarchy_layer.html.erb @@ -13,7 +13,7 @@ - <%= link_to_if(!request.params.dig(:filter, "type_sesrollup")&.include?(id.to_s), "#{@hierarchy_data.dig(id, :name)} (#{ @type_facets[id] || 0 })", url_for(apply_filter_url(request.params, 'type_sesrollup', id)), class: 'modifiable-link') %> + <%= link_to_if(!request.params.dig(:filter, "type_sesrollup")&.include?(id.to_s), "#{@hierarchy_data.dig(id, :name)} (#{ number_to_delimited(@type_facets[id] || 0, separator: ",") })", url_for(apply_filter_url(request.params, 'type_sesrollup', id)), class: 'modifiable-link') %> <% if @hierarchy_data.dig(id) %> <% @hierarchy_data.dig(id, :children).each do |child| %> <%= render 'hierarchy_layer', id: child.dig(:id), tier: tier + 1, parent_id: id %> diff --git a/app/views/search/results/facets/_date_facet.html.erb b/app/views/search/results/facets/_date_facet.html.erb index bed51d2..8337d9e 100644 --- a/app/views/search/results/facets/_date_facet.html.erb +++ b/app/views/search/results/facets/_date_facet.html.erb @@ -8,7 +8,7 @@
<% @search_data.months(year).each_with_index do |month, index| %>
- <%= link_to_unless(request.params.dig(:filter, "month")&.include?(month['val'].to_date.strftime("%Y-%-m")), "#{month['val'].to_date.strftime("%B")} #{year} (#{month['count']})", url_for(replace_filter_url(request.params, "month", year + "-#{index + 1}")), class: "menu-link modifiable-link") %> + <%= link_to_unless(request.params.dig(:filter, "month")&.include?(month['val'].to_date.strftime("%Y-%-m")), "#{month['val'].to_date.strftime("%B")} #{year} (#{number_to_delimited(month['count'], separator: ",")})", url_for(replace_filter_url(request.params, "month", year + "-#{index + 1}")), class: "menu-link modifiable-link") %>
<% end %>
@@ -25,7 +25,7 @@
<% @search_data.months(year).each_with_index do |month, index| %>
- <%= link_to_unless(request.params.dig(:filter, "month")&.include?(month['val'].to_date.strftime("%Y-%-m")), "#{month['val'].to_date.strftime("%B")} #{year} (#{month['count']})", url_for(replace_filter_url(request.params, "month", year + "-#{index + 1}")), class: "menu-link modifiable-link") %> + <%= link_to_unless(request.params.dig(:filter, "month")&.include?(month['val'].to_date.strftime("%Y-%-m")), "#{month['val'].to_date.strftime("%B")} #{year} (#{number_to_delimited(month['count'], separator: ",")})", url_for(replace_filter_url(request.params, "month", year + "-#{index + 1}")), class: "menu-link modifiable-link") %>
<% end %>
@@ -42,7 +42,7 @@
<% @search_data.years[0..4].each do |year_data| %>
- <%= link_to("#{year_data["val"].to_date.year} (#{year_data["count"]})", url_for(apply_filter_url(request.params, "year", year_data["val"].to_date.year)), class: "menu-link modifiable-link") %> + <%= link_to("#{year_data["val"].to_date.year} (#{number_to_delimited(year_data['count'], separator: ",")})", url_for(apply_filter_url(request.params, "year", year_data["val"].to_date.year)), class: "menu-link modifiable-link") %>
<% end %> <% unless @search_data.years[5..].blank? %> @@ -50,7 +50,7 @@ More <% @search_data.years[5..].each do |year_data| %>
- <%= link_to("#{year_data["val"].to_date.year} (#{year_data["count"]})", url_for(apply_filter_url(request.params, "year", year_data["val"].to_date.year)), class: "menu-link modifiable-link") %> + <%= link_to("#{year_data["val"].to_date.year} (#{number_to_delimited(year_data['count'], separator: ",")})", url_for(apply_filter_url(request.params, "year", year_data["val"].to_date.year)), class: "menu-link modifiable-link") %>
<% end %> diff --git a/app/views/search/results/facets/_session_facet.html.erb b/app/views/search/results/facets/_session_facet.html.erb index af8a2d6..b426e26 100644 --- a/app/views/search/results/facets/_session_facet.html.erb +++ b/app/views/search/results/facets/_session_facet.html.erb @@ -6,7 +6,7 @@
<% SolrSearch.sessions[0..4].each do |session| %>
- <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{facet_data.dig("session_#{session}", "count")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> + <%= 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 %> @@ -15,7 +15,7 @@ More <% SolrSearch.sessions[5..].each do |session| %>
- <%= link_to_unless(request.params.dig(:filter, "session")&.include?(session), "#{session} (#{facet_data.dig("session_#{session}", "count")})", url_for(apply_filter_url(request.params, "session", session)), class: "menu-link modifiable-link") %> + <%= 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 %>