-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:scientist-softserv/palni-palci
- Loading branch information
Showing
35 changed files
with
230 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class SearchHistoryController < ApplicationController | ||
include Blacklight::SearchHistory | ||
|
||
helper BlacklightRangeLimit::ViewHelperOverride | ||
helper RangeLimitHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
app/views/blacklight_range_limit/_range_limit_panel.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<%- # requires solr_config local passed in | ||
field_config = range_config(field_name) | ||
label = facet_field_label(field_name) | ||
|
||
input_label_range_begin = field_config[:input_label_range_begin] || t("blacklight.range_limit.range_begin", field_label: label) | ||
input_label_range_end = field_config[:input_label_range_end] || t("blacklight.range_limit.range_end", field_label: label) | ||
maxlength = field_config[:maxlength] | ||
-%> | ||
|
||
<div class="limit_content range_limit"> | ||
<% if has_selected_range_limit?(field_name) %> | ||
<ul class="current list-unstyled facet-values"> | ||
<li class="selected"> | ||
<span class="facet-label"> | ||
<span class="selected"><%= range_display(field_name) %></span> | ||
<%= link_to remove_range_param(field_name), :class=>"remove", :title => t('blacklight.range_limit.remove_limit') do %> | ||
<span class="glyphicon glyphicon-remove"></span> | ||
<span class="sr-only">[<%= t('blacklight.range_limit.remove_limit') %>]</span> | ||
<% end %> | ||
</span> | ||
<span class="selected facet-count"><%= number_with_delimiter(@response.total) %></span> | ||
</li> | ||
</ul> | ||
|
||
<% end %> | ||
<% unless selected_missing_for_range_limit?(field_name) %> | ||
<%= form_tag search_action_path, :method => :get, class: [BlacklightRangeLimit.classes[:form], "range_#{field_name}"].join(' ') do %> | ||
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:page)) %> | ||
|
||
<!-- we need to include a dummy search_field parameter if none exists, | ||
to trick blacklight into displaying actual search results instead | ||
of home page. Not a great solution, but easiest for now. --> | ||
<% unless params.has_key?(:search_field) %> | ||
<%= hidden_field_tag("search_field", "dummy_range") %> | ||
<% end %> | ||
|
||
<div class="range_input_wrapper mt-2"> | ||
<div class="year-input">Between year:</div> | ||
<%= render_range_input(field_name, :begin, input_label_range_begin, maxlength) %> | ||
</div> | ||
|
||
<div class="range_input_wrapper mt-2"> | ||
<div class="year-input">and year:</div> | ||
<%= render_range_input(field_name, :end, input_label_range_end, maxlength) %> | ||
</div> | ||
<div class="range_input_wrapper mt-2 mb-2"> | ||
<%= submit_tag t('blacklight.range_limit.submit_limit'), class: BlacklightRangeLimit.classes[:submit] %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
|
||
<!-- no results profile if missing is selected --> | ||
<% unless selected_missing_for_range_limit?(field_name) %> | ||
<!-- you can hide this if you want, but it has to be on page if you want | ||
JS slider and calculated facets to show up, JS sniffs it. --> | ||
<div class="profile"> | ||
<% if stats_for_field?(field_name) %> | ||
<!-- No stats information found for field in search response --> | ||
<% end %> | ||
<% if (min = range_results_endpoint(field_name, :min)) && | ||
(max = range_results_endpoint(field_name, :max)) %> | ||
<p class="range subsection <%= "slider_js" unless field_config[:slider_js] == false %>"> | ||
Current results range from <span class="min"><%= range_results_endpoint(field_name, :min) %></span> to <span class="max"><%= range_results_endpoint(field_name, :max) %></span> | ||
</p> | ||
|
||
<% if field_config[:segments] != false %> | ||
<div class="distribution subsection <%= 'chart_js' unless field_config[:chart_js] == false %>"> | ||
<!-- if we already fetched segments from solr, display them | ||
here. Otherwise, display a link to fetch them, which JS | ||
will AJAX fetch. --> | ||
<% if solr_range_queries_to_a(field_name).length > 0 %> | ||
<%= render(:partial => "blacklight_range_limit/range_segments", :locals => {:solr_field => field_name}) %> | ||
<% else %> | ||
<%= link_to('View distribution', main_app.url_for(search_state.to_h.merge(action: 'range_limit', range_field: field_name, range_start: min, range_end: max)), :class => "load_distribution") %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% if (stats = stats_for_field(field_name)) && stats["missing"] > 0 %> | ||
<ul class="missing list-unstyled facet-values subsection"> | ||
<li> | ||
<span class="facet-label"> | ||
<%= link_to BlacklightRangeLimit.labels[:missing], add_range_missing(field_name) %> | ||
</span> | ||
<span class="facet-count"> | ||
<%= number_with_delimiter(stats["missing"]) %> | ||
</span> | ||
</li> | ||
</ul> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> |
Oops, something went wrong.