geoblacklight 4.0.0.pre.rc3 → 4.1.0
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 +4 -4
- data/.github/workflows/ruby.yml +22 -16
- data/.standard.yml +1 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +13 -11
- data/README.md +22 -14
- data/Rakefile +42 -50
- data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +26 -0
- data/app/assets/images/blacklight/arizona.svg +4 -0
- data/app/assets/images/blacklight/circle-info-solid.svg +1 -0
- data/app/assets/images/blacklight/fire-solid.svg +1 -0
- data/app/assets/images/blacklight/geoblacklight-icons.json +98 -66
- data/app/assets/images/blacklight/george-mason.svg +4 -0
- data/app/assets/images/blacklight/lightbulb-solid.svg +1 -0
- data/app/assets/images/blacklight/nebraska.svg +4 -0
- data/app/assets/images/blacklight/rutgers.svg +5 -0
- data/app/assets/images/blacklight/triangle-exclamation-solid.svg +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +8 -0
- data/app/components/geoblacklight/display_note_component.html.erb +1 -0
- data/app/components/geoblacklight/display_note_component.rb +47 -0
- data/app/components/geoblacklight/icon_facet_item_component.rb +2 -2
- data/app/controllers/download_controller.rb +36 -37
- data/app/controllers/relation_controller.rb +1 -0
- data/app/controllers/wms_controller.rb +1 -0
- data/app/helpers/arcgis_helper.rb +2 -1
- data/app/helpers/blacklight_helper.rb +2 -1
- data/app/helpers/carto_helper.rb +3 -2
- data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +2 -1
- data/app/helpers/geoblacklight_helper.rb +44 -36
- data/app/models/concerns/geoblacklight/bbox_filter_query.rb +1 -1
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +3 -2
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document.rb +17 -9
- data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +2 -1
- data/app/presenters/geoblacklight/document_presenter.rb +3 -2
- data/app/views/catalog/_show_default_display_note.html.erb +7 -0
- data/app/views/catalog/_show_sidebar.html.erb +1 -0
- data/app/views/catalog/_show_sidebar_static_map.html.erb +10 -0
- data/app/views/relation/index.json.jbuilder +1 -1
- data/config/initializers/new_gbl_settings_defaults_4.1.yml +104 -0
- data/config/initializers/rails_config.rb +5 -1
- data/config/locales/geoblacklight.en.yml +19 -10
- data/geoblacklight.gemspec +36 -40
- data/lib/generators/geoblacklight/assets_generator.rb +15 -15
- data/lib/generators/geoblacklight/install_generator.rb +24 -23
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +66 -71
- data/lib/generators/geoblacklight/templates/settings.yml +74 -22
- data/lib/geoblacklight/bounding_box.rb +1 -0
- data/lib/geoblacklight/constants.rb +26 -25
- data/lib/geoblacklight/download/geojson_download.rb +10 -9
- data/lib/geoblacklight/download/geotiff_download.rb +6 -5
- data/lib/geoblacklight/download/hgl_download.rb +4 -3
- data/lib/geoblacklight/download/kmz_download.rb +11 -10
- data/lib/geoblacklight/download/shapefile_download.rb +10 -9
- data/lib/geoblacklight/download.rb +12 -11
- data/lib/geoblacklight/engine.rb +10 -9
- data/lib/geoblacklight/exceptions.rb +3 -0
- data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +12 -11
- data/lib/geoblacklight/geometry.rb +6 -5
- data/lib/geoblacklight/item_viewer.rb +4 -3
- data/lib/geoblacklight/metadata/base.rb +4 -3
- data/lib/geoblacklight/metadata/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata/html.rb +5 -4
- data/lib/geoblacklight/metadata/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +5 -4
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata_transformer.rb +6 -2
- data/lib/geoblacklight/reference.rb +3 -2
- data/lib/geoblacklight/references.rb +11 -6
- data/lib/geoblacklight/relation/ancestors.rb +4 -3
- data/lib/geoblacklight/relation/descendants.rb +4 -3
- data/lib/geoblacklight/relation/relation_response.rb +3 -2
- data/lib/geoblacklight/routes/downloadable.rb +3 -2
- data/lib/geoblacklight/routes/exportable.rb +4 -3
- data/lib/geoblacklight/routes/wms.rb +2 -1
- data/lib/geoblacklight/routes.rb +4 -3
- data/lib/geoblacklight/version.rb +2 -1
- data/lib/geoblacklight/view_helper_override.rb +3 -2
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +5 -4
- data/lib/geoblacklight/wms_layer.rb +4 -3
- data/lib/geoblacklight.rb +32 -31
- data/lib/tasks/geoblacklight.rake +57 -39
- data/schema/geoblacklight-schema-1.0.json +3 -3
- data/schema/geoblacklight-schema-aardvark.json +6 -0
- data/schema/readme.md +8 -0
- data/spec/components/geoblacklight/display_note_component_spec.rb +27 -0
- data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +11 -10
- data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +8 -7
- data/spec/config/initializers/rails_config_spec.rb +10 -9
- data/spec/controllers/catalog_controller_spec.rb +27 -26
- data/spec/controllers/download_controller_spec.rb +50 -49
- data/spec/controllers/relation_controller_spec.rb +5 -4
- data/spec/controllers/wms_controller_spec.rb +10 -9
- data/spec/factories/user.rb +3 -2
- data/spec/features/bookmarks_spec.rb +7 -6
- data/spec/features/configurable_basemap_spec.rb +12 -11
- data/spec/features/data_dictionary_download_spec.rb +11 -10
- data/spec/features/download_layer_spec.rb +64 -63
- data/spec/features/empty_search_spec.rb +6 -5
- data/spec/features/esri_viewer_spec.rb +33 -32
- data/spec/features/exports_spec.rb +18 -17
- data/spec/features/full_screen_controll_spec.rb +8 -8
- data/spec/features/help_text_spec.rb +6 -5
- data/spec/features/home_page_spec.rb +30 -29
- data/spec/features/iiif_viewer_spec.rb +6 -5
- data/spec/features/index_map_spec.rb +17 -16
- data/spec/features/layer_inspection_spec.rb +8 -7
- data/spec/features/layer_opacity_spec.rb +15 -14
- data/spec/features/layer_preview_spec.rb +11 -10
- data/spec/features/layer_with_no_references_spec.rb +5 -4
- data/spec/features/linkified_attribute_table_spec.rb +8 -7
- data/spec/features/metadata_panel_spec.rb +32 -31
- data/spec/features/missing_metadata_spec.rb +18 -17
- data/spec/features/multiple_downloads_spec.rb +11 -10
- data/spec/features/oembed_spec.rb +6 -5
- data/spec/features/relations_spec.rb +51 -26
- data/spec/features/saved_searches_spec.rb +7 -6
- data/spec/features/search_bar_spec.rb +9 -8
- data/spec/features/search_results_complex_geometry_spec.rb +12 -11
- data/spec/features/search_results_icons_spec.rb +10 -9
- data/spec/features/search_results_map_spec.rb +21 -20
- data/spec/features/search_results_overlap_ratio_spec.rb +17 -16
- data/spec/features/search_spec.rb +19 -18
- data/spec/features/show_page_download_spec.rb +15 -14
- data/spec/features/show_page_metadata_spec.rb +9 -8
- data/spec/features/show_page_sidebar_static_map_spec.rb +21 -0
- data/spec/features/sms_spec.rb +12 -11
- data/spec/features/split_view.html.erb_spec.rb +56 -55
- data/spec/features/suppressed_records_spec.rb +10 -9
- data/spec/features/tilejson_spec.rb +9 -8
- data/spec/features/tms_spec.rb +6 -5
- data/spec/features/web_services_modal_spec.rb +37 -36
- data/spec/features/wmts_spec.rb +16 -15
- data/spec/features/xyz_spec.rb +6 -5
- data/spec/fixtures/solr_documents/actual-papermap1.json +1 -1
- data/spec/fixtures/solr_documents/actual-point1.json +1 -1
- data/spec/fixtures/solr_documents/actual-polygon1.json +1 -1
- data/spec/fixtures/solr_documents/actual-raster1.json +1 -1
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +1 -1
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +1 -1
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +2 -2
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +1 -1
- data/spec/fixtures/solr_documents/display-note.json +52 -0
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +1 -1
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-feature-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +1 -1
- data/spec/fixtures/solr_documents/esri-wms-layer.json +1 -1
- data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +1 -1
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +1 -1
- data/spec/fixtures/solr_documents/index-map-polygon.json +1 -1
- data/spec/fixtures/solr_documents/index-map-stanford.json +1 -1
- data/spec/fixtures/solr_documents/index_map_point.json +1 -1
- data/spec/fixtures/solr_documents/princeton-parent.json +1 -1
- data/spec/fixtures/solr_documents/public_direct_download.json +1 -1
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
- data/spec/fixtures/solr_documents/restricted-line.json +1 -1
- data/spec/fixtures/solr_documents/tilejson.json +2 -2
- data/spec/fixtures/solr_documents/umn_metro_result1.json +2 -2
- data/spec/fixtures/solr_documents/umn_state_result1.json +1 -1
- data/spec/fixtures/solr_documents/umn_state_result2.json +1 -1
- data/spec/fixtures/solr_documents/uva_slug_colon.json +1 -1
- data/spec/fixtures/solr_documents/wmts-multiple.json +1 -1
- data/spec/fixtures/solr_documents/wmts-single-layer.json +6 -6
- data/spec/fixtures/solr_documents/xyz.json +3 -3
- data/spec/helpers/arcgis_helper_spec.rb +8 -7
- data/spec/helpers/carto_helper_spec.rb +6 -5
- data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +10 -15
- data/spec/helpers/geoblacklight_helper_spec.rb +139 -138
- data/spec/lib/geoblacklight/bounding_box_spec.rb +14 -13
- data/spec/lib/geoblacklight/document_presenter_spec.rb +26 -25
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +16 -15
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +9 -8
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +8 -7
- data/spec/lib/geoblacklight/download_spec.rb +61 -60
- data/spec/lib/geoblacklight/geometry_spec.rb +29 -28
- data/spec/lib/geoblacklight/item_viewer_spec.rb +25 -24
- data/spec/lib/geoblacklight/metadata/base_spec.rb +44 -43
- data/spec/lib/geoblacklight/metadata/html_spec.rb +7 -6
- data/spec/lib/geoblacklight/metadata_spec.rb +15 -14
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +13 -12
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +8 -7
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +8 -7
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +15 -14
- data/spec/lib/geoblacklight/reference_spec.rb +28 -27
- data/spec/lib/geoblacklight/references_spec.rb +89 -76
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +17 -16
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +17 -16
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +29 -28
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +14 -13
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +19 -18
- data/spec/lib/geoblacklight/wms_layer_spec.rb +31 -30
- data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +31 -31
- data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +32 -32
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +16 -15
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +7 -6
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +16 -17
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +7 -6
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +121 -107
- data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +8 -7
- data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +10 -10
- data/spec/routing/catalog_routing_spec.rb +4 -3
- data/spec/spec_helper.rb +34 -33
- data/spec/support/backport_test_helpers.rb +6 -5
- data/spec/support/features/session_helpers.rb +8 -7
- data/spec/support/features.rb +2 -1
- data/spec/support/fixtures.rb +2 -1
- data/spec/tasks/geoblacklight_spec.rb +10 -9
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +16 -15
- data/spec/views/catalog/_document_split.html.erb_spec.rb +3 -2
- data/spec/views/catalog/_index_split.html.erb_spec.rb +3 -2
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +5 -4
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +11 -10
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +13 -12
- data/template.rb +9 -8
- metadata +31 -212
- data/.gitmodules +0 -0
- data/.rubocop.yml +0 -111
- data/.rubocop_todo.yml +0 -418
- data/config/initializers/new_gbl_settings_defaults_3_4.yml +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module ArcgisHelper
|
|
3
4
|
##
|
|
4
5
|
# Generates an ArcGIS.com viewer url with params that can open content
|
|
@@ -8,6 +9,6 @@ module ArcgisHelper
|
|
|
8
9
|
params = URI.encode_www_form(
|
|
9
10
|
urls: arcgis_urls
|
|
10
11
|
)
|
|
11
|
-
Settings.ARCGIS_BASE_URL +
|
|
12
|
+
Settings.ARCGIS_BASE_URL + "?" + params
|
|
12
13
|
end
|
|
13
14
|
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module BlacklightHelper
|
|
3
4
|
include Blacklight::BlacklightHelperBehavior
|
|
4
5
|
include Geoblacklight::GeoblacklightHelperBehavior
|
|
5
6
|
include Blacklight::CatalogHelperBehavior
|
|
6
7
|
|
|
7
8
|
def render_document_sidebar_partial(document = @document)
|
|
8
|
-
super(document) + (render
|
|
9
|
+
super(document) + (render "relations_container", document: document)
|
|
9
10
|
end
|
|
10
11
|
end
|
data/app/helpers/carto_helper.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module CartoHelper
|
|
3
4
|
##
|
|
4
5
|
# Creates a Carto OneClick link, using the configuration link
|
|
@@ -10,14 +11,14 @@ module CartoHelper
|
|
|
10
11
|
provider: carto_provider,
|
|
11
12
|
logo: Settings.APPLICATION_LOGO_URL
|
|
12
13
|
)
|
|
13
|
-
carto_oneclick_host +
|
|
14
|
+
carto_oneclick_host + "?" + params
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
##
|
|
17
18
|
# Removes blank space from provider to accomodate Carto OneClick
|
|
18
19
|
#
|
|
19
20
|
def carto_provider
|
|
20
|
-
application_name.delete(
|
|
21
|
+
application_name.delete(" ")
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
private
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
##
|
|
3
4
|
# Adds helper behavior logic for GeoBlacklight, to used alongside
|
|
4
5
|
# BlacklightHelperBehavior
|
|
@@ -11,7 +12,7 @@ module Geoblacklight
|
|
|
11
12
|
# @param [Symbol, String] presenting_method
|
|
12
13
|
# @return [String]
|
|
13
14
|
def geoblacklight_present(presenting_method, document = @document)
|
|
14
|
-
document_presenter(document).try(presenting_method.to_sym) ||
|
|
15
|
+
document_presenter(document).try(presenting_method.to_sym) || ""
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module GeoblacklightHelper
|
|
3
4
|
def document_available?
|
|
4
5
|
@document.public? || (@document.same_institution? && user_signed_in?)
|
|
@@ -9,17 +10,17 @@ module GeoblacklightHelper
|
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
def iiif_jpg_url
|
|
12
|
-
@document.references.iiif.endpoint.sub!
|
|
13
|
+
@document.references.iiif.endpoint.sub! "info.json", "full/full/0/default.jpg"
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def download_link_file(label, id, url)
|
|
16
17
|
link_to(
|
|
17
18
|
label,
|
|
18
19
|
url,
|
|
19
|
-
|
|
20
|
-
data
|
|
21
|
-
download:
|
|
22
|
-
download_type:
|
|
20
|
+
"contentUrl" => url,
|
|
21
|
+
:data => {
|
|
22
|
+
download: "trigger",
|
|
23
|
+
download_type: "direct",
|
|
23
24
|
download_id: id
|
|
24
25
|
}
|
|
25
26
|
)
|
|
@@ -30,9 +31,9 @@ module GeoblacklightHelper
|
|
|
30
31
|
text,
|
|
31
32
|
download_hgl_path(id: document),
|
|
32
33
|
data: {
|
|
33
|
-
blacklight_modal:
|
|
34
|
-
download:
|
|
35
|
-
download_type:
|
|
34
|
+
blacklight_modal: "trigger",
|
|
35
|
+
download: "trigger",
|
|
36
|
+
download_type: "harvard-hgl",
|
|
36
37
|
download_id: document.id
|
|
37
38
|
}
|
|
38
39
|
)
|
|
@@ -42,22 +43,22 @@ module GeoblacklightHelper
|
|
|
42
43
|
# @return [String]
|
|
43
44
|
def download_link_iiif
|
|
44
45
|
link_to(
|
|
45
|
-
download_text(
|
|
46
|
+
download_text("JPG"),
|
|
46
47
|
iiif_jpg_url,
|
|
47
|
-
|
|
48
|
-
data
|
|
49
|
-
download:
|
|
48
|
+
"contentUrl" => iiif_jpg_url,
|
|
49
|
+
:data => {
|
|
50
|
+
download: "trigger"
|
|
50
51
|
}
|
|
51
52
|
)
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
def download_link_generated(download_type, document)
|
|
55
56
|
link_to(
|
|
56
|
-
t(
|
|
57
|
-
|
|
57
|
+
t("geoblacklight.download.export_link", download_format: export_format_label(download_type)),
|
|
58
|
+
"",
|
|
58
59
|
data: {
|
|
59
60
|
download_path: download_path(document.id, type: download_type),
|
|
60
|
-
download:
|
|
61
|
+
download: "trigger",
|
|
61
62
|
download_type: download_type,
|
|
62
63
|
download_id: document.id
|
|
63
64
|
}
|
|
@@ -69,18 +70,18 @@ module GeoblacklightHelper
|
|
|
69
70
|
# @param [SolrDocument] args
|
|
70
71
|
# @return [String]
|
|
71
72
|
def snippit(args)
|
|
72
|
-
truncate(Array(args[:value]).flatten.join(
|
|
73
|
+
truncate(Array(args[:value]).flatten.join(" "), length: 150)
|
|
73
74
|
end
|
|
74
75
|
|
|
75
76
|
##
|
|
76
77
|
# Returns an SVG icon or empty HTML span element
|
|
77
78
|
# @return [SVG or HTML tag]
|
|
78
79
|
def geoblacklight_icon(name, **args)
|
|
79
|
-
icon_name = name ? name.to_s.parameterize :
|
|
80
|
+
icon_name = name ? name.to_s.parameterize : "none"
|
|
80
81
|
begin
|
|
81
82
|
blacklight_icon(icon_name, **args)
|
|
82
83
|
rescue Blacklight::Exceptions::IconNotFound
|
|
83
|
-
tag.span class:
|
|
84
|
+
tag.span class: "icon-missing geoblacklight-none"
|
|
84
85
|
end
|
|
85
86
|
end
|
|
86
87
|
|
|
@@ -88,12 +89,12 @@ module GeoblacklightHelper
|
|
|
88
89
|
# Looks up properly formatted names for formats
|
|
89
90
|
#
|
|
90
91
|
def proper_case_format(format)
|
|
91
|
-
t("geoblacklight.formats.#{format.to_s.parameterize(separator:
|
|
92
|
+
t("geoblacklight.formats.#{format.to_s.parameterize(separator: "_")}")
|
|
92
93
|
end
|
|
93
94
|
|
|
94
95
|
# Format labels are customized for exports - look up the appropriate key.
|
|
95
96
|
def export_format_label(format)
|
|
96
|
-
t("geoblacklight.download.export_#{format.to_s.parameterize(separator:
|
|
97
|
+
t("geoblacklight.download.export_#{format.to_s.parameterize(separator: "_")}_link")
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
##
|
|
@@ -109,7 +110,7 @@ module GeoblacklightHelper
|
|
|
109
110
|
#
|
|
110
111
|
def download_text(format)
|
|
111
112
|
download_format = proper_case_format(format)
|
|
112
|
-
value = t(
|
|
113
|
+
value = t("geoblacklight.download.download_link", download_format: download_format)
|
|
113
114
|
value.html_safe
|
|
114
115
|
end
|
|
115
116
|
|
|
@@ -126,16 +127,23 @@ module GeoblacklightHelper
|
|
|
126
127
|
def render_help_text_entry(feature, key)
|
|
127
128
|
if I18n.exists?("geoblacklight.help_text.#{feature}.#{key}", locale)
|
|
128
129
|
help_text = I18n.t("geoblacklight.help_text.#{feature}.#{key}")
|
|
129
|
-
tag.h3 class:
|
|
130
|
-
tag.a data: {
|
|
130
|
+
tag.h3 class: "help-text viewer_protocol h6" do
|
|
131
|
+
tag.a data: {toggle: "popover", title: help_text[:title], content: help_text[:content]} do
|
|
131
132
|
help_text[:title]
|
|
132
133
|
end
|
|
133
134
|
end
|
|
134
135
|
else
|
|
135
|
-
tag.span class:
|
|
136
|
+
tag.span class: "help-text translation-missing"
|
|
136
137
|
end
|
|
137
138
|
end
|
|
138
139
|
|
|
140
|
+
##
|
|
141
|
+
# Determines if item view should render the sidebar static map
|
|
142
|
+
# @return [Boolean]
|
|
143
|
+
def render_sidebar_map?(document)
|
|
144
|
+
Settings.SIDEBAR_STATIC_MAP&.any? { |vp| document.viewer_protocol == vp }
|
|
145
|
+
end
|
|
146
|
+
|
|
139
147
|
##
|
|
140
148
|
# Deteremines if item view should include attribute table
|
|
141
149
|
# @return [Boolean]
|
|
@@ -149,8 +157,8 @@ module GeoblacklightHelper
|
|
|
149
157
|
# get_field_values method
|
|
150
158
|
# @param [Hash] args from get_field_values
|
|
151
159
|
def render_value_as_truncate_abstract(args)
|
|
152
|
-
tag.div class:
|
|
153
|
-
Array(args[:value]).flatten.join(
|
|
160
|
+
tag.div class: "truncate-abstract" do
|
|
161
|
+
Array(args[:value]).flatten.join(" ")
|
|
154
162
|
end
|
|
155
163
|
end
|
|
156
164
|
|
|
@@ -158,7 +166,7 @@ module GeoblacklightHelper
|
|
|
158
166
|
# Selects the basemap used for map displays
|
|
159
167
|
# @return [String]
|
|
160
168
|
def geoblacklight_basemap
|
|
161
|
-
blacklight_config.basemap_provider ||
|
|
169
|
+
blacklight_config.basemap_provider || "positron"
|
|
162
170
|
end
|
|
163
171
|
|
|
164
172
|
##
|
|
@@ -168,10 +176,10 @@ module GeoblacklightHelper
|
|
|
168
176
|
def render_web_services(reference)
|
|
169
177
|
render(
|
|
170
178
|
partial: "web_services_#{reference.type}",
|
|
171
|
-
locals: {
|
|
179
|
+
locals: {reference: reference}
|
|
172
180
|
)
|
|
173
181
|
rescue ActionView::MissingTemplate
|
|
174
|
-
render partial:
|
|
182
|
+
render partial: "web_services_default", locals: {reference: reference}
|
|
175
183
|
end
|
|
176
184
|
|
|
177
185
|
##
|
|
@@ -187,13 +195,13 @@ module GeoblacklightHelper
|
|
|
187
195
|
# @param [Geoblacklight::Metadata::Base] metadata the metadata object
|
|
188
196
|
# @return [String]
|
|
189
197
|
def render_transformed_metadata(metadata)
|
|
190
|
-
render partial:
|
|
198
|
+
render partial: "catalog/metadata/content", locals: {content: metadata.transform.html_safe}
|
|
191
199
|
rescue Geoblacklight::MetadataTransformer::TransformError => transform_err
|
|
192
200
|
Geoblacklight.logger.warn transform_err.message
|
|
193
|
-
render partial:
|
|
201
|
+
render partial: "catalog/metadata/markup", locals: {content: metadata.to_xml}
|
|
194
202
|
rescue => err
|
|
195
203
|
Geoblacklight.logger.warn err.message
|
|
196
|
-
render partial:
|
|
204
|
+
render partial: "catalog/metadata/missing"
|
|
197
205
|
end
|
|
198
206
|
|
|
199
207
|
##
|
|
@@ -221,17 +229,17 @@ module GeoblacklightHelper
|
|
|
221
229
|
icon_name = document[Settings.FIELDS.GEOM_TYPE] if Settings.USE_GEOM_FOR_RELATIONS_ICON
|
|
222
230
|
icon_name = icon if icon_name.blank?
|
|
223
231
|
icon_options = {}
|
|
224
|
-
icon_options = {
|
|
232
|
+
icon_options = {classes: "svg_tooltip"} if Settings.USE_GEOM_FOR_RELATIONS_ICON
|
|
225
233
|
geoblacklight_icon(icon_name, **icon_options)
|
|
226
234
|
end
|
|
227
235
|
|
|
228
236
|
## Returns the data-map attribute value used as the JS map selector
|
|
229
237
|
def results_js_map_selector(controller_name)
|
|
230
238
|
case controller_name
|
|
231
|
-
when
|
|
232
|
-
|
|
239
|
+
when "bookmarks"
|
|
240
|
+
"bookmarks"
|
|
233
241
|
else
|
|
234
|
-
|
|
242
|
+
"index"
|
|
235
243
|
end
|
|
236
244
|
end
|
|
237
245
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module Geoblacklight
|
|
3
4
|
module SolrDocument
|
|
4
5
|
module Citation
|
|
@@ -11,8 +12,8 @@ module Geoblacklight
|
|
|
11
12
|
fetch(Settings.FIELDS.TITLE, nil),
|
|
12
13
|
("[#{format}]" if format),
|
|
13
14
|
fetch(Settings.FIELDS.PUBLISHER, nil),
|
|
14
|
-
I18n.t(
|
|
15
|
-
].flatten.compact.join(
|
|
15
|
+
I18n.t("geoblacklight.citation.retrieved_from", document_url: solr_document_url)
|
|
16
|
+
].flatten.compact.join(". ")
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
private
|
|
@@ -20,11 +20,11 @@ module Geoblacklight
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def public?
|
|
23
|
-
rights_field_data.present? && rights_field_data.casecmp(
|
|
23
|
+
rights_field_data.present? && rights_field_data.casecmp("public").zero?
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def restricted?
|
|
27
|
-
rights_field_data.blank? || rights_field_data.casecmp(
|
|
27
|
+
rights_field_data.blank? || rights_field_data.casecmp("restricted").zero?
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def downloadable?
|
|
@@ -39,6 +39,10 @@ module Geoblacklight
|
|
|
39
39
|
references.download.to_hash if references.download.present?
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def display_note
|
|
43
|
+
fetch(Settings.FIELDS.DISPLAY_NOTE, "")
|
|
44
|
+
end
|
|
45
|
+
|
|
42
46
|
def hgl_download
|
|
43
47
|
references.hgl.to_hash if references.hgl.present?
|
|
44
48
|
end
|
|
@@ -48,7 +52,7 @@ module Geoblacklight
|
|
|
48
52
|
end
|
|
49
53
|
|
|
50
54
|
def same_institution?
|
|
51
|
-
fetch(Settings.FIELDS.PROVIDER,
|
|
55
|
+
fetch(Settings.FIELDS.PROVIDER, "").casecmp(Settings.INSTITUTION.downcase).zero?
|
|
52
56
|
end
|
|
53
57
|
|
|
54
58
|
def iiif_download
|
|
@@ -60,7 +64,7 @@ module Geoblacklight
|
|
|
60
64
|
end
|
|
61
65
|
|
|
62
66
|
def external_url
|
|
63
|
-
references.url
|
|
67
|
+
references.url&.endpoint
|
|
64
68
|
end
|
|
65
69
|
|
|
66
70
|
def item_viewer
|
|
@@ -68,11 +72,11 @@ module Geoblacklight
|
|
|
68
72
|
end
|
|
69
73
|
|
|
70
74
|
def itemtype
|
|
71
|
-
|
|
75
|
+
"http://schema.org/Dataset"
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
def geom_field
|
|
75
|
-
fetch(Settings.FIELDS.GEOMETRY,
|
|
79
|
+
fetch(Settings.FIELDS.GEOMETRY, "")
|
|
76
80
|
end
|
|
77
81
|
|
|
78
82
|
def geometry
|
|
@@ -80,7 +84,7 @@ module Geoblacklight
|
|
|
80
84
|
end
|
|
81
85
|
|
|
82
86
|
def wxs_identifier
|
|
83
|
-
fetch(Settings.FIELDS.WXS_IDENTIFIER,
|
|
87
|
+
fetch(Settings.FIELDS.WXS_IDENTIFIER, "")
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
def file_format
|
|
@@ -100,15 +104,19 @@ module Geoblacklight
|
|
|
100
104
|
private
|
|
101
105
|
|
|
102
106
|
def rights_field_data
|
|
103
|
-
fetch(Settings.FIELDS.ACCESS_RIGHTS,
|
|
107
|
+
fetch(Settings.FIELDS.ACCESS_RIGHTS, "")
|
|
104
108
|
end
|
|
105
109
|
|
|
106
110
|
def method_missing(method, *args, &block)
|
|
107
111
|
if /.*_url$/.match?(method.to_s)
|
|
108
|
-
checked_endpoint(method.to_s.gsub(
|
|
112
|
+
checked_endpoint(method.to_s.gsub("_url", ""))
|
|
109
113
|
else
|
|
110
114
|
super
|
|
111
115
|
end
|
|
112
116
|
end
|
|
117
|
+
|
|
118
|
+
def respond_to_missing?(method, *args, &block)
|
|
119
|
+
/.*_url$/.match?(method.to_s) || super
|
|
120
|
+
end
|
|
113
121
|
end
|
|
114
122
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module Geoblacklight
|
|
3
4
|
module SuppressedRecordsSearchBehavior
|
|
4
5
|
extend ActiveSupport::Concern
|
|
@@ -14,7 +15,7 @@ module Geoblacklight
|
|
|
14
15
|
def hide_suppressed_records(solr_params)
|
|
15
16
|
# Show suppressed records when searching relationships
|
|
16
17
|
return if blacklight_params.fetch(:f,
|
|
17
|
-
|
|
18
|
+
{}).keys.any? do |field|
|
|
18
19
|
Settings.RELATIONSHIPS_SHOWN.map do |_key, value|
|
|
19
20
|
value.field
|
|
20
21
|
end.include?(field)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module Geoblacklight
|
|
3
4
|
##
|
|
4
5
|
# Adds custom functionality for Geoblacklight document presentation
|
|
@@ -14,11 +15,11 @@ module Geoblacklight
|
|
|
14
15
|
@configuration.index_fields.each do |_field_name, field_config|
|
|
15
16
|
val = field_value(field_config)
|
|
16
17
|
if val.present?
|
|
17
|
-
val +=
|
|
18
|
+
val += "." unless val.end_with?(".")
|
|
18
19
|
fields_values << val
|
|
19
20
|
end
|
|
20
21
|
end
|
|
21
|
-
safe_join(fields_values,
|
|
22
|
+
safe_join(fields_values, " ")
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div class="card">
|
|
2
|
+
<div class="card-header">
|
|
3
|
+
<%= I18n.t('geoblacklight.location') %>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="card-body">
|
|
7
|
+
<%= content_tag :div, id: 'static-map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'item', protocol: 'Map', url: @document.viewer_endpoint, 'layer-id' => @document.wxs_identifier, 'map-geom' => @document.geometry.geojson, 'catalog-path'=> blacklight_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } do %>
|
|
8
|
+
<% end %>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
json.current_doc @relations.search_id
|
|
4
4
|
json.relations do
|
|
5
5
|
Settings.RELATIONSHIPS_SHOWN.each do |key, _value|
|
|
6
|
-
json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)[
|
|
6
|
+
json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)["numFound"].to_i.zero?
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# New GeoBlacklight v4.1 Settings
|
|
2
|
+
|
|
3
|
+
# Display Notes to display / Non-prefixed default bootstrap class is alert-secondary
|
|
4
|
+
DISPLAY_NOTES_SHOWN:
|
|
5
|
+
danger:
|
|
6
|
+
bootstrap_alert_class: alert-danger
|
|
7
|
+
icon: fire-solid
|
|
8
|
+
note_prefix: "Danger: "
|
|
9
|
+
info:
|
|
10
|
+
bootstrap_alert_class: alert-info
|
|
11
|
+
icon: circle-info-solid
|
|
12
|
+
note_prefix: "Info: "
|
|
13
|
+
tip:
|
|
14
|
+
bootstrap_alert_class: alert-success
|
|
15
|
+
icon: lightbulb-solid
|
|
16
|
+
note_prefix: "Tip: "
|
|
17
|
+
warning:
|
|
18
|
+
bootstrap_alert_class: alert-warning
|
|
19
|
+
icon: triangle-exclamation-solid
|
|
20
|
+
note_prefix: "Warning: "
|
|
21
|
+
|
|
22
|
+
# Solr field mappings (Added DISPLAY_NOTE)
|
|
23
|
+
FIELDS:
|
|
24
|
+
:DISPLAY_NOTE: 'gbl_displayNote_sm'
|
|
25
|
+
|
|
26
|
+
# Relationships to display
|
|
27
|
+
RELATIONSHIPS_SHOWN:
|
|
28
|
+
MEMBER_OF_ANCESTORS:
|
|
29
|
+
field: pcdm_memberOf_sm
|
|
30
|
+
icon: parent-item
|
|
31
|
+
inverse: :MEMBER_OF_DESCENDANTS
|
|
32
|
+
label: geoblacklight.relations.member_of_ancestors
|
|
33
|
+
query_type: ancestors
|
|
34
|
+
MEMBER_OF_DESCENDANTS:
|
|
35
|
+
field: pcdm_memberOf_sm
|
|
36
|
+
icon: child-item
|
|
37
|
+
inverse: :MEMBER_OF_ANCESTORS
|
|
38
|
+
label: geoblacklight.relations.member_of_descendants
|
|
39
|
+
query_type: descendants
|
|
40
|
+
PART_OF_ANCESTORS:
|
|
41
|
+
field: dct_isPartOf_sm
|
|
42
|
+
icon: parent-item
|
|
43
|
+
inverse: :PART_OF_DESCENDANTS
|
|
44
|
+
label: geoblacklight.relations.part_of_ancestors
|
|
45
|
+
query_type: ancestors
|
|
46
|
+
PART_OF_DESCENDANTS:
|
|
47
|
+
field: dct_isPartOf_sm
|
|
48
|
+
icon: child-item
|
|
49
|
+
inverse: :PART_OF_ANCESTORS
|
|
50
|
+
label: geoblacklight.relations.part_of_descendants
|
|
51
|
+
query_type: descendants
|
|
52
|
+
RELATION_ANCESTORS:
|
|
53
|
+
field: dct_relation_sm
|
|
54
|
+
icon: nil
|
|
55
|
+
inverse: :RELATION_DESCENDANTS
|
|
56
|
+
label: geoblacklight.relations.relation_ancestors
|
|
57
|
+
query_type: ancestors
|
|
58
|
+
RELATION_DESCENDANTS:
|
|
59
|
+
field: dct_relation_sm
|
|
60
|
+
icon: nil
|
|
61
|
+
inverse: :RELATION_ANCESTORS
|
|
62
|
+
label: geoblacklight.relations.relation_descendants
|
|
63
|
+
query_type: descendants
|
|
64
|
+
REPLACES_ANCESTORS:
|
|
65
|
+
field: dct_replaces_sm
|
|
66
|
+
icon: nil
|
|
67
|
+
inverse: :REPLACES_DESCENDANTS
|
|
68
|
+
label: geoblacklight.relations.replaces_ancestors
|
|
69
|
+
query_type: ancestors
|
|
70
|
+
REPLACES_DESCENDANTS:
|
|
71
|
+
field: dct_replaces_sm
|
|
72
|
+
icon: nil
|
|
73
|
+
inverse: :REPLACES_ANCESTORS
|
|
74
|
+
label: geoblacklight.relations.replaces_descendants
|
|
75
|
+
query_type: descendants
|
|
76
|
+
SOURCE_ANCESTORS:
|
|
77
|
+
field: dct_source_sm
|
|
78
|
+
icon: parent-item
|
|
79
|
+
inverse: :SOURCE_DESCENDANTS
|
|
80
|
+
label: geoblacklight.relations.source_ancestors
|
|
81
|
+
query_type: ancestors
|
|
82
|
+
SOURCE_DESCENDANTS:
|
|
83
|
+
field: dct_source_sm
|
|
84
|
+
icon: child-item
|
|
85
|
+
inverse: :SOURCE_ANCESTORS
|
|
86
|
+
label: geoblacklight.relations.source_descendants
|
|
87
|
+
query_type: descendants
|
|
88
|
+
VERSION_OF_ANCESTORS:
|
|
89
|
+
field: dct_isVersionOf_sm
|
|
90
|
+
icon: parent-item
|
|
91
|
+
inverse: :VERSION_OF_DESCENDANTS
|
|
92
|
+
label: geoblacklight.relations.version_of_ancestors
|
|
93
|
+
query_type: ancestors
|
|
94
|
+
VERSION_OF_DESCENDANTS:
|
|
95
|
+
field: dct_isVersionOf_sm
|
|
96
|
+
icon: child-item
|
|
97
|
+
inverse: :VERSION_OF_ANCESTORS
|
|
98
|
+
label: geoblacklight.relations.version_of_descendants
|
|
99
|
+
query_type: descendants
|
|
100
|
+
|
|
101
|
+
# Enable catalog#show sidebar static map for items with the following viewer protocols
|
|
102
|
+
SIDEBAR_STATIC_MAP:
|
|
103
|
+
- 'iiif'
|
|
104
|
+
- 'iiif_manifest'
|