<%- # requires solr_config local passed in field_config = range_config(solr_field) -%>

<%= facet_field_labels[solr_field] -%>

<% if params["range"] && params["range"][solr_field] && ( (! params["range"][solr_field]["begin"].blank?) || (! params["range"][solr_field]["end"].blank?) || params["range"][solr_field]["missing"]) %>
<%= range_display(solr_field) %> (<%= format_num(@response.total) %>) <%= link_to "[remove]", remove_range_param(solr_field), :class=>"remove" %>
<% end %> <% unless params["range"] && params["range"][solr_field] && params["range"][solr_field]["missing"] %> <%= form_tag catalog_index_path, :method => :get, :class=>"range_limit subsection range_#{solr_field}" do %> <%= search_as_hidden_fields %> <% unless params.has_key?(:search_field) %> <%= hidden_field_tag("search_field", "dummy_range") %> <% end %> <%= render_range_input(solr_field, :begin) %> - <%= render_range_input(solr_field, :end) %> <%= submit_tag 'Limit', :class=>'submit ui-state-default ui-corner-all' %> <% end %> <% end %> <% unless params["range"] && params["range"][solr_field] && params["range"][solr_field]["missing"] %>
<% if (min = range_results_endpoint(solr_field, :min)) && (max = range_results_endpoint(solr_field, :max)) %>
"> Current results range from <%= range_results_endpoint(solr_field, :min) %> to <%= range_results_endpoint(solr_field, :max) %>
<% if field_config[:segments] != false %>
<% if solr_range_queries_to_a(solr_field).length > 0 %> <%= render(:partial => "blacklight_range_limit/range_segments", :locals => {:solr_field => solr_field}) %> <% else %> <%= link_to('View distribution', params.merge(:action => 'range_limit', :range_field => solr_field, :range_start => min, :range_end => max), :class => "load_distribution") %> <% end %>
<% end %> <% end %> <% if (stats = stats_for_field(solr_field)) && stats["missing"] > 0 %>
<%= link_to BlacklightRangeLimit.labels[:missing], add_range_missing(solr_field) %> <%= render_facet_count(stats["missing"]) %>
<% end %>
<% end %>