europeana-blacklight 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332413f00fbe66dc175eb213d174b4e3aa7f67b0
|
4
|
+
data.tar.gz: c5a1b0b0ae51b4ee350289659cb8c6978c455984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba0200e294ce97524fc25d645bfc88fe96c1d4b6c01ffcbafed8d3758d7bf1d02cfdd6eb1fcc672505750e90bb8f051400b2237e65435b7b7655c3a2a3f1df1f
|
7
|
+
data.tar.gz: dc63f5f6b57840fa6609c96c86aa2d1721907ed9b7a681b440c7a227a3d823ffb2746b246276c379545f8257a9c7cb630b8d7ab0d555f8c15b2b3a62af2c10be
|
@@ -43,18 +43,27 @@ module Europeana
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def lang_map_value(lang_map, locale)
|
46
|
-
|
47
|
-
return nil unless
|
46
|
+
keys = salient_lang_map_keys(lang_map, locale)
|
47
|
+
return nil unless keys.present?
|
48
|
+
keys.map { |k| lang_map[k] }.flatten.uniq
|
49
|
+
end
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
protected
|
52
|
+
|
53
|
+
def salient_lang_map_keys(lang_map, locale)
|
54
|
+
iso_code = locale.split('-').first
|
55
|
+
iso_locale = ISO_639.find(iso_code)
|
56
|
+
|
57
|
+
# Favour exact matches
|
58
|
+
keys = lang_map.keys.select do |k|
|
59
|
+
[locale, iso_locale.alpha2, iso_locale.alpha3].include?(k)
|
60
|
+
end.flatten.compact
|
61
|
+
return keys unless keys.blank?
|
62
|
+
|
63
|
+
# Any sub-code will do
|
64
|
+
lang_map.keys.select do |k|
|
65
|
+
k =~ %r{\A#{iso_code}-}
|
66
|
+
end.flatten.compact
|
58
67
|
end
|
59
68
|
end
|
60
69
|
|
@@ -205,8 +205,7 @@ module Europeana
|
|
205
205
|
def api_request_facet_fields
|
206
206
|
@api_request_facet_fields ||= blacklight_config.facet_fields.select do |field_name, facet|
|
207
207
|
!facet.query &&
|
208
|
-
|
209
|
-
(field_name == 'REUSABILITY' || Europeana::API::Search::Fields.include?(field_name))
|
208
|
+
(facet.include_in_request || (facet.include_in_request.nil? && blacklight_config.add_facet_fields_to_solr_request))
|
210
209
|
end
|
211
210
|
end
|
212
211
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: europeana-blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Doe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|