geoblacklight 1.9.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/.rubocop.yml +4 -14
- data/.rubocop_todo.yml +51 -48
- data/README.md +3 -0
- data/Rakefile +1 -2
- data/app/assets/javascripts/geoblacklight/basemaps.js +3 -3
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/download.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/home.js +3 -2
- data/app/assets/javascripts/geoblacklight/modules/util.js +8 -0
- data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +19 -0
- data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +15 -13
- data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +3 -3
- data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +4 -2
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +20 -12
- data/app/assets/javascripts/geoblacklight/viewers/map.js +2 -1
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -5
- data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +43 -0
- data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +4 -1
- data/app/assets/stylesheets/geoblacklight/application.scss +0 -1
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +33 -13
- data/app/assets/stylesheets/geoblacklight/modules/home.scss +22 -19
- data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +7 -0
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +7 -8
- data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +9 -0
- data/app/assets/stylesheets/geoblacklight/modules/relations.scss +15 -0
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +7 -2
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +60 -0
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +55 -35
- data/app/controllers/download_controller.rb +5 -4
- data/app/controllers/relation_controller.rb +11 -1
- data/app/helpers/carto_helper.rb +2 -9
- data/app/helpers/geoblacklight_helper.rb +15 -28
- data/app/models/concerns/geoblacklight/solr_document.rb +4 -0
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +18 -1
- data/app/presenters/geoblacklight/document_presenter.rb +2 -2
- data/app/views/catalog/_document_action.html.erb +2 -2
- data/app/views/catalog/_document_split.html.erb +5 -3
- data/app/views/catalog/_downloads_secondary.html.erb +39 -0
- data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +30 -38
- data/app/views/catalog/_index_split_default.html.erb +1 -2
- data/app/views/catalog/_metadata.html.erb +3 -3
- data/app/views/catalog/_show_default_attribute_table.html.erb +16 -14
- data/app/views/catalog/_show_default_viewer_container.html.erb +5 -3
- data/app/views/catalog/_show_default_viewer_information.html.erb +3 -1
- data/app/views/catalog/_show_downloads.html.erb +12 -9
- data/app/views/catalog/_show_tools.html.erb +25 -0
- data/app/views/catalog/_web_services.html.erb +1 -1
- data/app/views/catalog/_web_services_wfs.html.erb +1 -1
- data/app/views/catalog/_web_services_wms.html.erb +1 -1
- data/app/views/catalog/index.html.erb +9 -8
- data/app/views/relation/_ancestors.html.erb +2 -2
- data/app/views/relation/_descendants.html.erb +3 -3
- data/app/views/relation/index.html.erb +8 -8
- data/app/views/shared/_header_navbar.html.erb +28 -17
- data/config/locales/geoblacklight.en.yml +2 -2
- data/geoblacklight.gemspec +5 -4
- data/lib/generators/geoblacklight/install_generator.rb +3 -12
- data/lib/generators/geoblacklight/templates/Procfile +3 -0
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +33 -5
- data/lib/generators/geoblacklight/templates/package.json +14 -0
- data/lib/generators/geoblacklight/templates/settings.yml +15 -1
- data/lib/generators/geoblacklight/templates/webpacker.yml +67 -0
- data/lib/generators/geoblacklight/webpacker_generator.rb +35 -0
- data/lib/geoblacklight.rb +2 -4
- data/lib/geoblacklight/controller_override.rb +27 -22
- data/lib/geoblacklight/engine.rb +0 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/tasks/geoblacklight.rake +18 -0
- data/schema/geoblacklight-schema.md +72 -59
- data/schema/geometry-type-values.md +1 -0
- data/schema/references.md +22 -0
- data/schema/schema-commentary.md +198 -0
- data/schema/subjects.md +41 -0
- data/schema/type-values.md +4 -2
- data/solr/conf/core.properties +5 -0
- data/solr/conf/schema.xml +11 -1
- data/solr/conf/solrconfig.xml +1 -1
- data/spec/controllers/catalog_controller_spec.rb +17 -1
- data/spec/factories/user.rb +2 -2
- data/spec/features/download_layer_spec.rb +19 -15
- data/spec/features/esri_viewer_spec.rb +2 -2
- data/spec/features/home_page_spec.rb +6 -2
- data/spec/features/index_map_spec.rb +15 -25
- data/spec/features/layer_opacity_spec.rb +1 -1
- data/spec/features/layer_preview_spec.rb +3 -2
- data/spec/features/linkified_attribute_table_spec.rb +3 -4
- data/spec/features/relations_spec.rb +1 -1
- data/spec/features/search_bar_spec.rb +2 -2
- data/spec/features/search_results_map_spec.rb +2 -2
- data/spec/features/search_results_overlap_ratio_spec.rb +55 -0
- data/spec/features/search_spec.rb +13 -0
- data/spec/features/show_page_metadata_spec.rb +1 -1
- data/spec/features/sms_spec.rb +15 -0
- data/spec/features/split_view.html.erb_spec.rb +24 -15
- data/spec/features/web_services_modal_spec.rb +0 -2
- data/spec/fixtures/solr_documents/README.md +38 -0
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +39 -18
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +37 -0
- data/spec/fixtures/solr_documents/index-map-polygon.json +37 -0
- data/spec/fixtures/solr_documents/{point_index_map.json → index_map_point.json} +1 -1
- data/spec/fixtures/solr_documents/princeton-child1.json +30 -0
- data/spec/fixtures/solr_documents/princeton-child2.json +30 -0
- data/spec/fixtures/solr_documents/princeton-parent.json +25 -0
- data/spec/helpers/carto_helper_spec.rb +1 -20
- data/spec/helpers/geoblacklight_helper_spec.rb +4 -22
- data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -1
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +10 -0
- data/spec/spec_helper.rb +6 -3
- data/spec/teaspoon_env.rb +31 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +5 -0
- data/spec/test_app_templates/solr_documents +1 -0
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +39 -0
- data/template.rb +4 -2
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/esri-leaflet.js.map +1 -0
- data/vendor/assets/javascripts/leaflet-src.js.map +1 -0
- data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
- data/vendor/assets/stylesheets/leaflet.css +635 -0
- metadata +87 -33
- data/app/assets/stylesheets/geoblacklight/modules/twitter-typeahead.scss +0 -14
- data/app/views/catalog/_search_form_no_navbar.html.erb +0 -22
- data/app/views/catalog/_show_default.html.erb +0 -13
- data/app/views/catalog/_upper_metadata.html.erb +0 -20
- data/spec/fixtures/solr_documents/umn_metro_result2.json +0 -39
@@ -0,0 +1,60 @@
|
|
1
|
+
// Mixins and shared properties for sidebar elements
|
2
|
+
|
3
|
+
@mixin sidebar-children {
|
4
|
+
%list-group-item-children {
|
5
|
+
padding: 10px, 15px;
|
6
|
+
}
|
7
|
+
|
8
|
+
%list-group-item-anchors {
|
9
|
+
text-align: center;
|
10
|
+
width: 1.4em;
|
11
|
+
}
|
12
|
+
|
13
|
+
margin-top: 16px;
|
14
|
+
margin-bottom: 16px;
|
15
|
+
|
16
|
+
.card-header {
|
17
|
+
h2 {
|
18
|
+
display: inline-block;
|
19
|
+
padding-top: 8px;
|
20
|
+
padding-bottom: 8px;
|
21
|
+
margin-bottom: 0px;
|
22
|
+
font-size: 1rem;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.card-subtitle {
|
27
|
+
margin: 1rem 0 .2rem;
|
28
|
+
font-size: .9rem;
|
29
|
+
font-weight: normal;
|
30
|
+
color: $gray-600;
|
31
|
+
}
|
32
|
+
|
33
|
+
.list-group {
|
34
|
+
padding-top: 24px;
|
35
|
+
padding-bottom: 24px;
|
36
|
+
padding-left: 4px;
|
37
|
+
padding-right: 4px;
|
38
|
+
|
39
|
+
.list-group-item {
|
40
|
+
border-color: $white;
|
41
|
+
padding: 8px 16px;
|
42
|
+
|
43
|
+
a {
|
44
|
+
@extend %list-group-item-children;
|
45
|
+
|
46
|
+
.geoblacklight {
|
47
|
+
color: $gray-600;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
&-nested {
|
53
|
+
padding: 0;
|
54
|
+
|
55
|
+
.list-group-item {
|
56
|
+
padding: 8px 0;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
@@ -1,46 +1,66 @@
|
|
1
1
|
.show-tools {
|
2
|
-
|
3
|
-
color: $gray-light;
|
4
|
-
}
|
2
|
+
@include sidebar-children;
|
5
3
|
|
6
|
-
.
|
7
|
-
text-align: center;
|
8
|
-
width: 1.4em;
|
9
|
-
}
|
4
|
+
.list-group {
|
10
5
|
|
11
|
-
|
12
|
-
text-align: center;
|
13
|
-
width: 1.4em;
|
14
|
-
}
|
6
|
+
.list-group-item {
|
15
7
|
|
16
|
-
|
17
|
-
|
18
|
-
width: 1.4em;
|
19
|
-
}
|
8
|
+
form {
|
9
|
+
@extend %list-group-item-children;
|
20
10
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
11
|
+
.checkbox {
|
12
|
+
margin-left: 4px;
|
13
|
+
margin-right: 4px;
|
25
14
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
15
|
+
label {
|
16
|
+
margin-bottom: inherit;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
30
20
|
|
31
|
-
|
32
|
-
text-align: center;
|
33
|
-
width: 1.4em;
|
34
|
-
}
|
21
|
+
a {
|
35
22
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
23
|
+
.geoblacklight {
|
24
|
+
|
25
|
+
&-citation {
|
26
|
+
@extend %list-group-item-anchors;
|
27
|
+
}
|
28
|
+
|
29
|
+
&-data-dictionary {
|
30
|
+
@extend %list-group-item-anchors;
|
31
|
+
}
|
32
|
+
|
33
|
+
&-sms {
|
34
|
+
@extend %list-group-item-anchors;
|
35
|
+
}
|
36
|
+
|
37
|
+
&-email {
|
38
|
+
@extend %list-group-item-anchors;
|
39
|
+
}
|
40
|
+
|
41
|
+
&-web_services {
|
42
|
+
@extend %list-group-item-anchors;
|
43
|
+
}
|
44
|
+
|
45
|
+
&-metadata {
|
46
|
+
@extend %list-group-item-anchors;
|
47
|
+
}
|
48
|
+
|
49
|
+
&-carto {
|
50
|
+
@extend %list-group-item-anchors;
|
51
|
+
}
|
52
|
+
|
53
|
+
// DEPRECATED: Will be removed in GeoBlacklight v2.0
|
54
|
+
&-cartodb {
|
55
|
+
@extend %list-group-item-anchors;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
40
60
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
61
|
+
.downloads {
|
62
|
+
margin-left: 4px;
|
63
|
+
margin-right: 4px;
|
64
|
+
}
|
45
65
|
}
|
46
66
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class DownloadController < ApplicationController
|
2
|
-
include Blacklight::SearchHelper
|
2
|
+
# include Blacklight::SearchHelper
|
3
|
+
include Blacklight::Catalog
|
3
4
|
|
4
5
|
rescue_from Geoblacklight::Exceptions::ExternalDownloadFailed do |exception|
|
5
6
|
Geoblacklight.logger.error exception.message + ' ' + exception.url
|
@@ -18,7 +19,7 @@ class DownloadController < ApplicationController
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def show
|
21
|
-
@response, @document = fetch params[:id]
|
22
|
+
@response, @document = search_service.fetch params[:id]
|
22
23
|
restricted_should_authenticate
|
23
24
|
response = check_type
|
24
25
|
validate response
|
@@ -30,13 +31,13 @@ class DownloadController < ApplicationController
|
|
30
31
|
|
31
32
|
def file
|
32
33
|
# Grab the solr document to check if it should be public or not
|
33
|
-
@response, @document = fetch(file_name_to_id(params[:id]))
|
34
|
+
@response, @document = search_service.fetch(file_name_to_id(params[:id]))
|
34
35
|
restricted_should_authenticate
|
35
36
|
send_file download_file_path_and_name, x_sendfile: true
|
36
37
|
end
|
37
38
|
|
38
39
|
def hgl
|
39
|
-
@response, @document = fetch params[:id]
|
40
|
+
@response, @document = search_service.fetch params[:id]
|
40
41
|
if params[:email]
|
41
42
|
response = Geoblacklight::HglDownload.new(@document, params[:email]).get
|
42
43
|
if response.nil?
|
@@ -1,10 +1,20 @@
|
|
1
1
|
class RelationController < ApplicationController
|
2
2
|
include Blacklight::Configurable
|
3
|
-
include Blacklight::SearchHelper
|
3
|
+
# include Blacklight::SearchHelper
|
4
4
|
copy_blacklight_config_from(CatalogController)
|
5
5
|
|
6
6
|
def index
|
7
7
|
@relations = Geoblacklight::Relation::RelationResponse.new(params[:id], repository)
|
8
8
|
render layout: !request.xhr?
|
9
9
|
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def repository_class
|
14
|
+
blacklight_config.repository_class
|
15
|
+
end
|
16
|
+
|
17
|
+
def repository
|
18
|
+
@repository ||= repository_class.new(blacklight_config)
|
19
|
+
end
|
10
20
|
end
|
data/app/helpers/carto_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module CartoHelper
|
2
2
|
##
|
3
|
-
# Creates a Carto OneClick link
|
3
|
+
# Creates a Carto OneClick link, using the configuration link
|
4
4
|
# @param [String] file_link
|
5
5
|
# @return [String]
|
6
6
|
def carto_link(file_link)
|
@@ -24,13 +24,6 @@ module CartoHelper
|
|
24
24
|
##
|
25
25
|
# Method used to access setting and provide deprecation warnings to migrate
|
26
26
|
def carto_oneclick_host
|
27
|
-
|
28
|
-
Deprecation.warn(
|
29
|
-
GeoblacklightHelper,
|
30
|
-
'Settings.CARTODB_ONECLICK_LINK is deprecated and will be removed in ' \
|
31
|
-
'Geoblacklight 2.0.0, use Settings.CARTO_ONECLICK_LINK instead'
|
32
|
-
)
|
33
|
-
end
|
34
|
-
Settings.CARTO_ONECLICK_LINK || Settings.CARTODB_ONECLICK_LINK
|
27
|
+
Settings.CARTO_ONECLICK_LINK
|
35
28
|
end
|
36
29
|
end
|
@@ -1,15 +1,4 @@
|
|
1
1
|
module GeoblacklightHelper
|
2
|
-
extend Deprecation
|
3
|
-
self.deprecation_horizon = 'Geoblacklight 2.0.0'
|
4
|
-
|
5
|
-
def sms_helper
|
6
|
-
content_tag(:i, '', class: 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
|
7
|
-
end
|
8
|
-
|
9
|
-
def email_helper
|
10
|
-
content_tag(:i, '', class: 'fa fa-envelope fa-fw') + ' ' + t('blacklight.tools.email')
|
11
|
-
end
|
12
|
-
|
13
2
|
def document_available?
|
14
3
|
@document.public? || (@document.same_institution? && user_signed_in?)
|
15
4
|
end
|
@@ -27,7 +16,7 @@ module GeoblacklightHelper
|
|
27
16
|
text,
|
28
17
|
document.direct_download[:download],
|
29
18
|
'contentUrl' => document.direct_download[:download],
|
30
|
-
class: ['btn', 'btn-
|
19
|
+
class: ['btn', 'btn-default', 'download', 'download-original'],
|
31
20
|
data: {
|
32
21
|
download: 'trigger',
|
33
22
|
download_type: 'direct',
|
@@ -40,9 +29,9 @@ module GeoblacklightHelper
|
|
40
29
|
link_to(
|
41
30
|
text,
|
42
31
|
download_hgl_path(id: document),
|
43
|
-
class: ['btn', 'btn-
|
32
|
+
class: ['btn', 'btn-default', 'download', 'download-original'],
|
44
33
|
data: {
|
45
|
-
|
34
|
+
blacklight_modal: 'trigger',
|
46
35
|
download: 'trigger',
|
47
36
|
download_type: 'harvard-hgl',
|
48
37
|
download_id: document.id
|
@@ -57,7 +46,7 @@ module GeoblacklightHelper
|
|
57
46
|
download_text('JPG'),
|
58
47
|
iiif_jpg_url,
|
59
48
|
'contentUrl' => iiif_jpg_url,
|
60
|
-
class: ['btn', 'btn-
|
49
|
+
class: ['btn', 'btn-default', 'download', 'download-generated'],
|
61
50
|
data: {
|
62
51
|
download: 'trigger'
|
63
52
|
}
|
@@ -68,7 +57,7 @@ module GeoblacklightHelper
|
|
68
57
|
link_to(
|
69
58
|
t('geoblacklight.download.export_link', download_format: proper_case_format(download_type)),
|
70
59
|
'',
|
71
|
-
class: ['btn', 'btn-
|
60
|
+
class: ['btn', 'btn-default', 'download', 'download-generated'],
|
72
61
|
data: {
|
73
62
|
download_path: download_path(document.id, type: download_type),
|
74
63
|
download: 'trigger',
|
@@ -100,10 +89,6 @@ module GeoblacklightHelper
|
|
100
89
|
title: name
|
101
90
|
end
|
102
91
|
|
103
|
-
def render_search_form_no_navbar
|
104
|
-
render partial: 'catalog/search_form_no_navbar'
|
105
|
-
end
|
106
|
-
|
107
92
|
##
|
108
93
|
# Renders an unique array of search links based off of terms
|
109
94
|
# passed in using the facet parameter
|
@@ -179,14 +164,6 @@ module GeoblacklightHelper
|
|
179
164
|
blacklight_config.basemap_provider || 'positron'
|
180
165
|
end
|
181
166
|
|
182
|
-
##
|
183
|
-
# Removes blank space from provider to accomodate CartoDB OneClick
|
184
|
-
# @deprecated Use {#carto_provider} instead.
|
185
|
-
def cartodb_provider
|
186
|
-
carto_provider
|
187
|
-
end
|
188
|
-
deprecation_deprecate cartodb_provider: 'use GeoblacklightHelper#carto_provider instead'
|
189
|
-
|
190
167
|
##
|
191
168
|
# Creates a Carto OneClick link link, using the configuration link
|
192
169
|
# @param [String] file_link
|
@@ -252,4 +229,14 @@ module GeoblacklightHelper
|
|
252
229
|
def first_metadata?(document, metadata)
|
253
230
|
document.references.shown_metadata.first.type == metadata.type
|
254
231
|
end
|
232
|
+
|
233
|
+
##
|
234
|
+
# Renders a reference url for a document
|
235
|
+
# @param [Hash] document, field_name
|
236
|
+
def render_references_url(args)
|
237
|
+
link_to(
|
238
|
+
args[:document].references.url.endpoint,
|
239
|
+
args[:document].references.url.endpoint
|
240
|
+
) if args[:document]&.references&.url
|
241
|
+
end
|
255
242
|
end
|
@@ -3,7 +3,7 @@ module Geoblacklight
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
self.default_processor_chain += [:add_spatial_params]
|
6
|
+
self.default_processor_chain += [:add_spatial_params, :hide_suppressed_records]
|
7
7
|
end
|
8
8
|
|
9
9
|
##
|
@@ -18,6 +18,12 @@ module Geoblacklight
|
|
18
18
|
solr_params[:bq] << "#{Settings.FIELDS.GEOMETRY}:\"IsWithin(#{envelope_bounds})\"#{boost}"
|
19
19
|
solr_params[:fq] ||= []
|
20
20
|
solr_params[:fq] << "#{Settings.FIELDS.GEOMETRY}:\"Intersects(#{envelope_bounds})\""
|
21
|
+
|
22
|
+
if Settings.OVERLAP_RATIO_BOOST
|
23
|
+
solr_params[:overlap] =
|
24
|
+
"{!field uf=* defType=lucene f=solr_bboxtype score=overlapRatio}Intersects(#{envelope_bounds})"
|
25
|
+
solr_params[:bf] = "$overlap^#{Settings.OVERLAP_RATIO_BOOST}"
|
26
|
+
end
|
21
27
|
end
|
22
28
|
solr_params
|
23
29
|
rescue Geoblacklight::Exceptions::WrongBoundingBoxFormat
|
@@ -43,5 +49,16 @@ module Geoblacklight
|
|
43
49
|
def bounding_box
|
44
50
|
Geoblacklight::BoundingBox.from_rectangle(blacklight_params[:bbox])
|
45
51
|
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Hide suppressed records in search
|
55
|
+
# @param [Blacklight::Solr::Request]
|
56
|
+
# @return [Blacklight::Solr::Request]
|
57
|
+
def hide_suppressed_records(solr_params)
|
58
|
+
# Show child records if searching for a specific source parent
|
59
|
+
return unless blacklight_params.fetch(:f, {})[Settings.FIELDS.SOURCE.to_sym].nil?
|
60
|
+
solr_params[:fq] ||= []
|
61
|
+
solr_params[:fq] << '-suppressed_b: true'
|
62
|
+
end
|
46
63
|
end
|
47
64
|
end
|
@@ -10,8 +10,8 @@ module Geoblacklight
|
|
10
10
|
# @return [String]
|
11
11
|
def index_fields_display
|
12
12
|
fields_values = []
|
13
|
-
@configuration.index_fields.each do |
|
14
|
-
val = field_value(
|
13
|
+
@configuration.index_fields.each do |_field_name, field_config|
|
14
|
+
val = field_value(field_config)
|
15
15
|
unless val.blank?
|
16
16
|
val += '.' unless val.end_with?('.')
|
17
17
|
fields_values << val
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= link_to document_action_path(document_action_config, (local_assigns.has_key?(:url_opts) ? url_opts : {}).merge(({id: document} if document) || {})),
|
2
2
|
id: document_action_config.fetch(:id, "#{document_action_config.key}Link"),
|
3
|
-
data: {}.merge(({
|
3
|
+
data: {}.merge(({blacklight_modal: "trigger"} if document_action_config.modal != false) || {}) do %>
|
4
4
|
<%= content_tag :span, '', class: "geoblacklight geoblacklight-#{document_action_config.key}" %>
|
5
5
|
<%= document_action_label(document_action_config.key, document_action_config) %>
|
6
|
-
<% end %>
|
6
|
+
<% end %>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
<div
|
2
|
-
|
1
|
+
<div class='row'>
|
2
|
+
<div id="documents" class="documents-list col-md-6">
|
3
|
+
<%= render documents, :as => :document %>
|
4
|
+
</div>
|
5
|
+
<%= content_tag :div, '', id: 'map', class: 'col-md-6', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
3
6
|
</div>
|
4
|
-
<%= content_tag :div, '', id: 'map', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<%# Renders the secondary downloads displayed in the split dropdown %>
|
2
|
+
<% document ||= @document %>
|
3
|
+
|
4
|
+
<button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
|
5
|
+
<span class='caret'></span>
|
6
|
+
<span class='sr-only'>Toggle Download Dropdown</span>
|
7
|
+
</button>
|
8
|
+
<ul class='dropdown-menu' role='menu'>
|
9
|
+
<% if document.hgl_download.present? %>
|
10
|
+
<li role="presentation" class="dropdown-header">Original</li>
|
11
|
+
<li>
|
12
|
+
<%= link_to(download_text(document.download_types.first[0]),
|
13
|
+
download_hgl_path(id: document), data: {blacklight_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document.id }) %>
|
14
|
+
</li>
|
15
|
+
<% else %>
|
16
|
+
<% if document.direct_download.present? %>
|
17
|
+
<li role="presentation" class="dropdown-header">Original</li>
|
18
|
+
<li>
|
19
|
+
<%= link_to(download_text(@document.file_format), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document.id }) %>
|
20
|
+
</li>
|
21
|
+
<% end %>
|
22
|
+
<% if document.download_types.present? || document.iiif_download.present? %>
|
23
|
+
<li role="presentation" class="dropdown-header">Generated</li>
|
24
|
+
<% end %>
|
25
|
+
<% if document.iiif_download.present? %>
|
26
|
+
<li>
|
27
|
+
<%= link_to "Download JPG", iiif_jpg_url, download: 'trigger' %>
|
28
|
+
</li>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<% if document.download_types.present? %>
|
32
|
+
<% document.download_types.each do |type| %>
|
33
|
+
<%= content_tag(:li) do %>
|
34
|
+
<% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document.id, type: type[0])}", download: 'trigger', download_type: type[0], download_id: document.id }) %>
|
35
|
+
<% end %>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
</ul>
|