blacklight_range_limit 6.3.2 → 6.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight_range_limit/range_limit_distro_facets.js +1 -1
- data/app/helpers/range_limit_helper.rb +18 -0
- data/app/views/blacklight_range_limit/_range_limit_panel.html.erb +8 -9
- data/lib/blacklight_range_limit/engine.rb +1 -0
- data/solr/conf/schema.xml +0 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f36982cd7ae0224c85406116f0ce81a46d604aba
|
4
|
+
data.tar.gz: ec2fcf93993ef6375f9de89b6f5a53bebb6d3b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91401d023fb8db93c5dcd050708f7cb8c6b043502b60faebb87b25e20915114c872e8244037a65f879f2d758deb6d0f41e506102146323c3f4c6961a4c50e57f
|
7
|
+
data.tar.gz: b0031855b0e90123b39c193b209de794963b09a0afcaeb9d922158d31a50b1b5b493cff9848ded63d8768d29baa4ca8ff63addd923f3857d10eabd749a8cde5c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.3.
|
1
|
+
6.3.3
|
@@ -37,7 +37,7 @@ Blacklight.onLoad(function() {
|
|
37
37
|
var container = $(event.target).filter(".facet-content").find(".chart_js");
|
38
38
|
|
39
39
|
// only if it doesn't already have a canvas, it isn't already drawn
|
40
|
-
if (container && container.find("canvas").
|
40
|
+
if (container && container.find("canvas").length == 0) {
|
41
41
|
// be willing to wait up to 1100ms for container to
|
42
42
|
// have width -- right away on show.bs is too soon, but
|
43
43
|
// shown.bs is later than we want, we want to start rendering
|
@@ -62,6 +62,10 @@ module RangeLimitHelper
|
|
62
62
|
@response["stats"]["stats_fields"][solr_field] if @response["stats"] && @response["stats"]["stats_fields"]
|
63
63
|
end
|
64
64
|
|
65
|
+
def stats_for_field?(solr_field)
|
66
|
+
stats_for_field(solr_field).present?
|
67
|
+
end
|
68
|
+
|
65
69
|
def add_range_missing(solr_field, my_params = params)
|
66
70
|
my_params = Blacklight::SearchState.new(my_params.except(:page), blacklight_config).to_h
|
67
71
|
my_params["range"] ||= {}
|
@@ -94,4 +98,18 @@ module RangeLimitHelper
|
|
94
98
|
return my_params
|
95
99
|
end
|
96
100
|
|
101
|
+
def has_selected_range_limit?(solr_field)
|
102
|
+
params["range"] &&
|
103
|
+
params["range"][solr_field] &&
|
104
|
+
(
|
105
|
+
params["range"][solr_field]["begin"].present? ||
|
106
|
+
params["range"][solr_field]["end"].present? ||
|
107
|
+
params["range"][solr_field]["missing"]
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
def selected_missing_for_range_limit?(solr_field)
|
112
|
+
params["range"] && params["range"][solr_field] && params["range"][solr_field]["missing"]
|
113
|
+
end
|
114
|
+
|
97
115
|
end
|
@@ -7,12 +7,8 @@
|
|
7
7
|
maxlength = field_config[:maxlength]
|
8
8
|
-%>
|
9
9
|
|
10
|
-
<div class="limit_content range_limit">
|
11
|
-
<% if
|
12
|
-
params["range"][solr_field] &&
|
13
|
-
( (! params["range"][solr_field]["begin"].blank?) ||
|
14
|
-
(! params["range"][solr_field]["end"].blank?) ||
|
15
|
-
params["range"][solr_field]["missing"]) %>
|
10
|
+
<div class="limit_content range_limit">
|
11
|
+
<% if has_selected_range_limit?(solr_field) %>
|
16
12
|
<ul class="current list-unstyled facet-values">
|
17
13
|
<li class="selected">
|
18
14
|
<span class="facet-label">
|
@@ -28,7 +24,7 @@
|
|
28
24
|
|
29
25
|
<% end %>
|
30
26
|
|
31
|
-
<% unless
|
27
|
+
<% unless selected_missing_for_range_limit?(solr_field) %>
|
32
28
|
<%= form_tag search_action_path, :method => :get, class: [BlacklightRangeLimit.classes[:form], "range_#{solr_field}"].join(' ') do %>
|
33
29
|
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:page)) %>
|
34
30
|
|
@@ -46,11 +42,14 @@
|
|
46
42
|
<% end %>
|
47
43
|
|
48
44
|
<!-- no results profile if missing is selected -->
|
49
|
-
<% unless
|
45
|
+
<% unless selected_missing_for_range_limit?(solr_field) %>
|
50
46
|
<!-- you can hide this if you want, but it has to be on page if you want
|
51
47
|
JS slider and calculated facets to show up, JS sniffs it. -->
|
52
48
|
<div class="profile">
|
53
|
-
|
49
|
+
<% if stats_for_field?(solr_field) %>
|
50
|
+
<!-- No stats information found for field in search response -->
|
51
|
+
<% end %>
|
52
|
+
|
54
53
|
<% if (min = range_results_endpoint(solr_field, :min)) &&
|
55
54
|
(max = range_results_endpoint(solr_field, :max)) %>
|
56
55
|
<p class="range subsection <%= "slider_js" unless field_config[:slider_js] == false %>">
|
data/solr/conf/schema.xml
CHANGED
@@ -544,12 +544,6 @@
|
|
544
544
|
-->
|
545
545
|
<uniqueKey>id</uniqueKey>
|
546
546
|
|
547
|
-
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
|
548
|
-
<defaultSearchField>text</defaultSearchField>
|
549
|
-
|
550
|
-
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
|
551
|
-
<solrQueryParser defaultOperator="OR"/>
|
552
|
-
|
553
547
|
<!-- copyField commands copy one field to another at the time a document
|
554
548
|
is added to the index. It's used either to index the same field differently,
|
555
549
|
or to add multiple fields to the same field for easier/faster searching. -->
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_range_limit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.3.
|
4
|
+
version: 6.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.6.
|
248
|
+
rubygems_version: 2.6.11
|
249
249
|
signing_key:
|
250
250
|
specification_version: 4
|
251
251
|
summary: Blacklight Range Limit plugin
|