geoblacklight 2.2.0 → 3.0.1
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 +212 -112
- data/.rubocop.yml +16 -14
- data/.rubocop_todo.yml +28 -151
- data/Gemfile +3 -8
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/app/assets/images/blacklight/arrow-circle-down.svg +1 -2
- data/app/assets/images/blacklight/baruch-cuny.svg +1 -4
- data/app/assets/images/blacklight/berkeley.svg +1 -4
- data/app/assets/images/blacklight/book.svg +1 -4
- data/app/assets/images/blacklight/bookmark.svg +1 -4
- data/app/assets/images/blacklight/cd-rom.svg +1 -4
- data/app/assets/images/blacklight/chicago.svg +1 -4
- data/app/assets/images/blacklight/citation.svg +3 -0
- data/app/assets/images/blacklight/collection.svg +3 -0
- data/app/assets/images/blacklight/columbia.svg +1 -4
- data/app/assets/images/blacklight/cornell.svg +1 -4
- data/app/assets/images/blacklight/dvd-rom.svg +1 -4
- data/app/assets/images/blacklight/email.svg +1 -4
- data/app/assets/images/blacklight/esri-globe.svg +1 -4
- data/app/assets/images/blacklight/globe.svg +1 -2
- data/app/assets/images/blacklight/harvard.svg +1 -4
- data/app/assets/images/blacklight/home.svg +1 -2
- data/app/assets/images/blacklight/illinois.svg +1 -4
- data/app/assets/images/blacklight/image.svg +1 -4
- data/app/assets/images/blacklight/indiana.svg +1 -4
- data/app/assets/images/blacklight/iowa.svg +1 -4
- data/app/assets/images/blacklight/leaf.svg +1 -4
- data/app/assets/images/blacklight/lewis-clark.svg +1 -4
- data/app/assets/images/blacklight/line.svg +1 -4
- data/app/assets/images/blacklight/map-marker.svg +1 -4
- data/app/assets/images/blacklight/map.svg +1 -4
- data/app/assets/images/blacklight/maryland.svg +1 -4
- data/app/assets/images/blacklight/massgis.svg +1 -4
- data/app/assets/images/blacklight/metadata.svg +1 -4
- data/app/assets/images/blacklight/michigan-state.svg +1 -4
- data/app/assets/images/blacklight/michigan.svg +1 -4
- data/app/assets/images/blacklight/minnesota.svg +1 -4
- data/app/assets/images/blacklight/mit.svg +1 -4
- data/app/assets/images/blacklight/mixed.svg +1 -4
- data/app/assets/images/blacklight/multilinestring.svg +1 -4
- data/app/assets/images/blacklight/multipoint.svg +1 -4
- data/app/assets/images/blacklight/multipolygon.svg +1 -4
- data/app/assets/images/blacklight/nyu.svg +1 -4
- data/app/assets/images/blacklight/ohio-state.svg +1 -4
- data/app/assets/images/blacklight/pagelines-brands.svg +1 -4
- data/app/assets/images/blacklight/paper-map.svg +1 -4
- data/app/assets/images/blacklight/penn-state.svg +1 -4
- data/app/assets/images/blacklight/point.svg +1 -4
- data/app/assets/images/blacklight/polygon.svg +1 -4
- data/app/assets/images/blacklight/polyline.svg +1 -4
- data/app/assets/images/blacklight/princeton.svg +1 -4
- data/app/assets/images/blacklight/public.svg +1 -4
- data/app/assets/images/blacklight/purdue.svg +1 -4
- data/app/assets/images/blacklight/raster.svg +1 -4
- data/app/assets/images/blacklight/restricted.svg +1 -4
- data/app/assets/images/blacklight/sms.svg +1 -4
- data/app/assets/images/blacklight/stanford.svg +1 -4
- data/app/assets/images/blacklight/table.svg +1 -4
- data/app/assets/images/blacklight/tags.svg +1 -2
- data/app/assets/images/blacklight/texas.svg +1 -4
- data/app/assets/images/blacklight/tufts.svg +1 -4
- data/app/assets/images/blacklight/ucla.svg +1 -4
- data/app/assets/images/blacklight/uva.svg +1 -4
- data/app/assets/images/blacklight/web_services.svg +1 -4
- data/app/assets/images/blacklight/wisconsin.svg +1 -4
- data/app/assets/javascripts/geoblacklight/basemaps.js +18 -0
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/geosearch.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/home.js +1 -1
- data/app/assets/javascripts/geoblacklight/modules/item.js +20 -1
- data/app/assets/javascripts/geoblacklight/modules/results.js +4 -2
- data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
- data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -10
- data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +13 -0
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +26 -29
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
- data/app/controllers/download_controller.rb +12 -12
- data/app/controllers/relation_controller.rb +1 -0
- data/app/controllers/wms_controller.rb +1 -0
- data/app/helpers/arcgis_helper.rb +1 -0
- data/app/helpers/blacklight_helper.rb +1 -0
- data/app/helpers/carto_helper.rb +1 -0
- data/app/helpers/geoblacklight_helper.rb +36 -79
- data/app/models/concerns/geoblacklight/solr_document.rb +15 -9
- data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +29 -0
- data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -1
- data/app/presenters/geoblacklight/document_presenter.rb +2 -1
- data/app/views/catalog/_arcgis.html.erb +4 -0
- data/app/views/catalog/_carto.html.erb +4 -0
- data/app/views/catalog/_citation.html.erb +11 -0
- data/app/views/catalog/_data_dictionary.html.erb +1 -1
- data/app/views/catalog/_document_action.html.erb +1 -1
- data/app/views/catalog/_document_split.html.erb +1 -1
- data/app/views/catalog/_downloads_primary.html.erb +8 -1
- data/app/views/catalog/_header_icons.html.erb +3 -3
- data/app/views/catalog/_home_text.html.erb +4 -1
- data/app/views/catalog/_index_split_default.html.erb +22 -14
- data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
- data/app/views/catalog/_web_services_wfs.html.erb +3 -3
- data/app/views/catalog/_web_services_wms.html.erb +3 -3
- data/app/views/catalog/metadata.html.erb +3 -1
- data/app/views/catalog/web_services.html.erb +9 -7
- data/app/views/relation/_ancestors.html.erb +2 -5
- data/app/views/relation/_descendants.html.erb +3 -6
- data/app/views/relation/index.html.erb +20 -8
- data/app/views/relation/index.json.jbuilder +2 -1
- data/app/views/shared/_header_navbar.html.erb +1 -3
- data/bin/coverage.rb +36 -0
- data/config/initializers/rails_config.rb +1 -0
- data/config/locales/geoblacklight.en.yml +46 -61
- data/geoblacklight.gemspec +5 -8
- data/lib/generators/geoblacklight/assets_generator.rb +46 -0
- data/lib/generators/geoblacklight/install_generator.rb +8 -9
- data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
- data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
- data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
- data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -1
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +6 -2
- data/lib/generators/geoblacklight/templates/settings.yml +4 -6
- data/lib/generators/geoblacklight/webpacker_generator.rb +2 -1
- data/lib/geoblacklight.rb +1 -0
- data/lib/geoblacklight/bounding_box.rb +1 -0
- data/lib/geoblacklight/catalog_helper_override.rb +2 -1
- data/lib/geoblacklight/constants.rb +1 -0
- data/lib/geoblacklight/download.rb +6 -5
- data/lib/geoblacklight/download/geojson_download.rb +1 -0
- data/lib/geoblacklight/download/geotiff_download.rb +1 -0
- data/lib/geoblacklight/download/hgl_download.rb +1 -0
- data/lib/geoblacklight/download/kmz_download.rb +2 -1
- data/lib/geoblacklight/download/shapefile_download.rb +1 -0
- data/lib/geoblacklight/engine.rb +2 -2
- data/lib/geoblacklight/exceptions.rb +1 -0
- data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
- data/lib/geoblacklight/item_viewer.rb +1 -0
- data/lib/geoblacklight/metadata.rb +1 -0
- data/lib/geoblacklight/metadata/base.rb +3 -2
- data/lib/geoblacklight/metadata/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata/html.rb +2 -2
- data/lib/geoblacklight/metadata/iso19139.rb +1 -0
- data/lib/geoblacklight/metadata_transformer.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
- data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
- data/lib/geoblacklight/reference.rb +1 -0
- data/lib/geoblacklight/references.rb +7 -3
- data/lib/geoblacklight/relation/ancestors.rb +2 -1
- data/lib/geoblacklight/relation/descendants.rb +2 -1
- data/lib/geoblacklight/relation/relation_response.rb +2 -1
- data/lib/geoblacklight/routes.rb +1 -0
- data/lib/geoblacklight/routes/downloadable.rb +1 -0
- data/lib/geoblacklight/routes/exportable.rb +1 -0
- data/lib/geoblacklight/routes/wms.rb +1 -0
- data/lib/geoblacklight/version.rb +2 -1
- data/lib/geoblacklight/view_helper_override.rb +2 -1
- data/lib/geoblacklight/wms_layer.rb +3 -2
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
- data/lib/tasks/geoblacklight.rake +33 -32
- data/solr/conf/schema.xml +5 -5
- data/spec/controllers/catalog_controller_spec.rb +1 -0
- data/spec/controllers/download_controller_spec.rb +2 -1
- data/spec/controllers/relation_controller_spec.rb +1 -0
- data/spec/controllers/wms_controller_spec.rb +2 -1
- data/spec/factories/user.rb +1 -0
- data/spec/features/bookmarks_spec.rb +1 -0
- data/spec/features/configurable_basemap_spec.rb +10 -0
- data/spec/features/data_dictionary_download_spec.rb +1 -0
- data/spec/features/download_layer_spec.rb +1 -0
- data/spec/features/empty_search_spec.rb +1 -0
- data/spec/features/esri_viewer_spec.rb +1 -6
- data/spec/features/exports_spec.rb +4 -12
- data/spec/features/help_text_spec.rb +1 -0
- data/spec/features/home_page_spec.rb +6 -0
- data/spec/features/iiif_viewer_spec.rb +1 -0
- data/spec/features/index_map_spec.rb +1 -0
- data/spec/features/layer_inspection_spec.rb +1 -0
- data/spec/features/layer_opacity_spec.rb +1 -0
- data/spec/features/layer_preview_spec.rb +1 -0
- data/spec/features/layer_with_no_references_spec.rb +1 -0
- data/spec/features/linkified_attribute_table_spec.rb +1 -0
- data/spec/features/metadata_panel_spec.rb +1 -0
- data/spec/features/missing_metadata_spec.rb +13 -0
- data/spec/features/multiple_downloads_spec.rb +15 -0
- data/spec/features/oembed_spec.rb +1 -0
- data/spec/features/relations_spec.rb +10 -28
- data/spec/features/saved_searches_spec.rb +1 -0
- data/spec/features/search_bar_spec.rb +1 -0
- data/spec/features/search_results_map_spec.rb +1 -6
- data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
- data/spec/features/search_spec.rb +1 -0
- data/spec/features/show_page_metadata_spec.rb +1 -0
- data/spec/features/sms_spec.rb +1 -0
- data/spec/features/split_view.html.erb_spec.rb +4 -3
- data/spec/features/suppressed_records_spec.rb +1 -0
- data/spec/features/web_services_modal_spec.rb +1 -0
- data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
- data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
- data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
- data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
- data/spec/helpers/arcgis_helper_spec.rb +1 -0
- data/spec/helpers/carto_helper_spec.rb +1 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +51 -5
- data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
- data/spec/javascripts/geoblacklight_spec.js +0 -4
- data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
- data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
- data/spec/lib/geoblacklight/download_spec.rb +4 -3
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
- data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata/base_spec.rb +4 -3
- data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
- data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
- data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
- data/spec/lib/geoblacklight/reference_spec.rb +1 -0
- data/spec/lib/geoblacklight/references_spec.rb +2 -3
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
- data/spec/lib/geoblacklight/wms_layer_spec.rb +3 -2
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +14 -0
- data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +27 -0
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
- data/spec/routing/catalog_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +12 -9
- data/spec/support/backport_test_helpers.rb +1 -0
- data/spec/support/features.rb +1 -0
- data/spec/support/features/session_helpers.rb +1 -0
- data/spec/support/fixtures.rb +8 -0
- data/spec/tasks/geoblacklight_spec.rb +19 -0
- data/spec/teaspoon_env.rb +1 -0
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
- data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
- data/template.rb +1 -0
- data/vendor/assets/stylesheets/leaflet.css +0 -1
- metadata +69 -79
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/geoblacklight/modules/collapse.js +0 -7
- data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
- data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
- data/app/views/catalog/_exports.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -25
- data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
- data/vendor/assets/javascripts/readmore.js +0 -618
- data/vendor/assets/javascripts/readmore.js.map +0 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
# Extends Blacklight::Solr::Document for GeoBlacklight specific functionalit
|
3
4
|
module SolrDocument
|
@@ -7,6 +8,7 @@ module Geoblacklight
|
|
7
8
|
include Geoblacklight::SolrDocument::Carto
|
8
9
|
include Geoblacklight::SolrDocument::Inspection
|
9
10
|
include Geoblacklight::SolrDocument::Arcgis
|
11
|
+
include Geoblacklight::SolrDocument::Citation
|
10
12
|
|
11
13
|
delegate :download_types, to: :references
|
12
14
|
delegate :viewer_protocol, to: :item_viewer
|
@@ -17,11 +19,11 @@ module Geoblacklight
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def public?
|
20
|
-
|
22
|
+
rights_field_data.present? && rights_field_data.casecmp('public').zero?
|
21
23
|
end
|
22
24
|
|
23
25
|
def restricted?
|
24
|
-
|
26
|
+
rights_field_data.blank? || rights_field_data.casecmp('restricted').zero?
|
25
27
|
end
|
26
28
|
|
27
29
|
def downloadable?
|
@@ -33,27 +35,27 @@ module Geoblacklight
|
|
33
35
|
end
|
34
36
|
|
35
37
|
def direct_download
|
36
|
-
references.download.to_hash
|
38
|
+
references.download.to_hash if references.download.present?
|
37
39
|
end
|
38
40
|
|
39
41
|
def hgl_download
|
40
|
-
references.hgl.to_hash
|
42
|
+
references.hgl.to_hash if references.hgl.present?
|
41
43
|
end
|
42
44
|
|
43
45
|
def oembed
|
44
|
-
references.oembed.endpoint
|
46
|
+
references.oembed.endpoint if references.oembed.present?
|
45
47
|
end
|
46
48
|
|
47
49
|
def same_institution?
|
48
|
-
fetch(Settings.FIELDS.PROVENANCE).casecmp(Settings.INSTITUTION.downcase).zero?
|
50
|
+
fetch(Settings.FIELDS.PROVENANCE, '').casecmp(Settings.INSTITUTION.downcase).zero?
|
49
51
|
end
|
50
52
|
|
51
53
|
def iiif_download
|
52
|
-
references.iiif.to_hash
|
54
|
+
references.iiif.to_hash if references.iiif.present?
|
53
55
|
end
|
54
56
|
|
55
57
|
def data_dictionary_download
|
56
|
-
references.data_dictionary.to_hash
|
58
|
+
references.data_dictionary.to_hash if references.data_dictionary.present?
|
57
59
|
end
|
58
60
|
|
59
61
|
def external_url
|
@@ -102,8 +104,12 @@ module Geoblacklight
|
|
102
104
|
|
103
105
|
private
|
104
106
|
|
107
|
+
def rights_field_data
|
108
|
+
fetch(Settings.FIELDS.RIGHTS, '')
|
109
|
+
end
|
110
|
+
|
105
111
|
def method_missing(method, *args, &block)
|
106
|
-
if /.*_url
|
112
|
+
if /.*_url$/.match?(method.to_s)
|
107
113
|
checked_endpoint(method.to_s.gsub('_url', ''))
|
108
114
|
else
|
109
115
|
super
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
module SolrDocument
|
3
4
|
module Arcgis
|
4
5
|
def arcgis_urls
|
5
|
-
return
|
6
|
+
return if references.esri_webservices.blank?
|
6
7
|
references.esri_webservices.map { |layer| layer.reference[1] if layer }.compact
|
7
8
|
end
|
8
9
|
end
|
@@ -1,21 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
module SolrDocument
|
3
4
|
##
|
4
5
|
# Module for providing external Carto download references for a document
|
5
6
|
module Carto
|
6
|
-
extend Deprecation
|
7
|
-
self.deprecation_horizon = 'Geoblacklight 2.0.0'
|
8
|
-
##
|
9
|
-
# Returns a url to a file that should be used with CartoDB integration
|
10
|
-
# @return [String]
|
11
|
-
# @deprecated Use {#carto_reference} instead
|
12
|
-
def cartodb_reference
|
13
|
-
carto_reference
|
14
|
-
end
|
15
|
-
deprecation_deprecate(
|
16
|
-
cartodb_reference: 'use Geoblacklight::SolrDocument::Carto#carto_reference instead'
|
17
|
-
)
|
18
|
-
|
19
7
|
##
|
20
8
|
# Returns a url to a file that should be used with CartoDB integration
|
21
9
|
# @return [String]
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Geoblacklight
|
3
|
+
module SolrDocument
|
4
|
+
module Citation
|
5
|
+
include ActionView::Helpers::OutputSafetyHelper
|
6
|
+
|
7
|
+
def geoblacklight_citation(solr_document_url)
|
8
|
+
[
|
9
|
+
fetch(Settings.FIELDS.CREATOR, nil),
|
10
|
+
("(#{issued})" if issued),
|
11
|
+
fetch(Settings.FIELDS.TITLE, nil),
|
12
|
+
("[#{format}]" if format),
|
13
|
+
fetch(Settings.FIELDS.PUBLISHER, nil),
|
14
|
+
I18n.t('geoblacklight.citation.retrieved_from', document_url: solr_document_url)
|
15
|
+
].flatten.compact.join('. ')
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def issued
|
21
|
+
fetch(Settings.FIELDS.ISSUED, nil)
|
22
|
+
end
|
23
|
+
|
24
|
+
def format
|
25
|
+
fetch(Settings.FIELDS.FILE_FORMAT, nil)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
module SolrDocument
|
3
4
|
##
|
@@ -7,7 +8,7 @@ module Geoblacklight
|
|
7
8
|
# Returns boolean about whether document viewer protocol is inspectable
|
8
9
|
# @return [Boolean]
|
9
10
|
def inspectable?
|
10
|
-
%w
|
11
|
+
%w[wms feature_layer dynamic_map_layer tiled_map_layer]
|
11
12
|
.include? viewer_protocol
|
12
13
|
end
|
13
14
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
module SpatialSearchBehavior
|
3
4
|
extend ActiveSupport::Concern
|
@@ -20,9 +21,10 @@ module Geoblacklight
|
|
20
21
|
solr_params[:fq] << "#{Settings.FIELDS.GEOMETRY}:\"Intersects(#{envelope_bounds})\""
|
21
22
|
|
22
23
|
if Settings.OVERLAP_RATIO_BOOST
|
24
|
+
solr_params[:bf] ||= []
|
23
25
|
solr_params[:overlap] =
|
24
26
|
"{!field uf=* defType=lucene f=solr_bboxtype score=overlapRatio}Intersects(#{envelope_bounds})"
|
25
|
-
solr_params[:bf]
|
27
|
+
solr_params[:bf] << "$overlap^#{Settings.OVERLAP_RATIO_BOOST}"
|
26
28
|
end
|
27
29
|
end
|
28
30
|
solr_params
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Geoblacklight
|
2
3
|
##
|
3
4
|
# Adds custom functionality for Geoblacklight document presentation
|
@@ -12,7 +13,7 @@ module Geoblacklight
|
|
12
13
|
fields_values = []
|
13
14
|
@configuration.index_fields.each do |_field_name, field_config|
|
14
15
|
val = field_value(field_config)
|
15
|
-
|
16
|
+
if val.present?
|
16
17
|
val += '.' unless val.end_with?('.')
|
17
18
|
fields_values << val
|
18
19
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="modal-header">
|
2
|
+
<h1><%= t('blacklight.tools.citation') %></h1>
|
3
|
+
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
|
4
|
+
<span aria-hidden="true">×</span>
|
5
|
+
</button>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<% @documents&.each do |document| %>
|
9
|
+
<%= document.geoblacklight_citation(solr_document_url(document)) %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if document.data_dictionary_download.present? %>
|
2
2
|
<%= link_to document.data_dictionary_download[:data_dictionary] do %>
|
3
|
-
<%= geoblacklight_icon('book') %>
|
3
|
+
<%= geoblacklight_icon('book', aria_hidden: true) %>
|
4
4
|
<%= t('geoblacklight.references.data_dictionary') %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
@@ -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
3
|
data: {}.merge(({blacklight_modal: "trigger"} if document_action_config.modal != false) || {}) do %>
|
4
|
-
<%= geoblacklight_icon(document_action_config.key) %>
|
4
|
+
<%= geoblacklight_icon(document_action_config.key, aria_hidden: true) %>
|
5
5
|
<%= document_action_label(document_action_config.key, document_action_config) %>
|
6
6
|
<% end %>
|
@@ -2,5 +2,5 @@
|
|
2
2
|
<div id="documents" class="documents-list col-md-6">
|
3
3
|
<%= render documents, :as => :document %>
|
4
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 } %>
|
5
|
+
<%= content_tag :div, '', id: 'map', class: 'col-md-6', aria: { label: t('geoblacklight.map.label') }, data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
6
6
|
</div>
|
@@ -2,7 +2,14 @@
|
|
2
2
|
<% document ||= @document %>
|
3
3
|
|
4
4
|
<% if document.direct_download.present? %>
|
5
|
-
|
5
|
+
<% if document.direct_download[:download].is_a? Array %>
|
6
|
+
<% document.direct_download[:download].each do |download| %>
|
7
|
+
<%= render partial: 'download_link', locals: { download_link: download_link_file(download['label'], document.id, download['url']) } %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<% if document.direct_download[:download].is_a? String %>
|
11
|
+
<%= render partial: 'download_link', locals: { download_link: download_link_direct(download_text(document.file_format), document) } %>
|
12
|
+
<% end %>
|
6
13
|
<% end %>
|
7
14
|
|
8
15
|
<% if document.hgl_download.present? %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE]) %>
|
2
|
-
<%= geoblacklight_icon(document[Settings.FIELDS.PROVENANCE]) %>
|
3
|
-
<%= geoblacklight_icon(document[Settings.FIELDS.RIGHTS]) %>
|
1
|
+
<%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE], classes: 'svg_tooltip') %>
|
2
|
+
<%= geoblacklight_icon(document[Settings.FIELDS.PROVENANCE], classes: 'svg_tooltip') %>
|
3
|
+
<%= geoblacklight_icon(document[Settings.FIELDS.RIGHTS], classes: 'svg_tooltip') %>
|
@@ -37,7 +37,10 @@
|
|
37
37
|
</div>
|
38
38
|
<div class='col-sm'>
|
39
39
|
<%= content_tag :h3, t('geoblacklight.home.map_heading') %>
|
40
|
-
<%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
40
|
+
<%= content_tag :div, '', id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
|
41
41
|
</div>
|
42
42
|
</div>
|
43
|
+
<div class="text-right">
|
44
|
+
<%= t('geoblacklight.home.version', version: Geoblacklight::VERSION ) %>
|
45
|
+
</div>
|
43
46
|
</div>
|
@@ -1,22 +1,30 @@
|
|
1
1
|
<% # header bar for doc items in index view -%>
|
2
|
-
<%= content_tag :div, class: 'documentHeader row', data: { layer_id: document.id, bbox: document.bounding_box_as_wsen } do %>
|
3
|
-
<
|
4
|
-
<%= render partial: 'header_icons', locals: { document: document } %>
|
5
|
-
</div>
|
6
|
-
<h3 class="index_title col-sm-9s cosl-lg-10 text-span">
|
7
|
-
<span class='caret-toggle'></span>
|
2
|
+
<%= content_tag :div, class: 'documentHeader index-split row', data: { layer_id: document.id, bbox: document.bounding_box_as_wsen } do %>
|
3
|
+
<h3 class="index_title col">
|
8
4
|
<% counter = document_counter_with_offset(document_counter) %>
|
9
5
|
<span class="document-counter">
|
10
6
|
<%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
|
11
7
|
</span>
|
12
|
-
<%= link_to_document document, counter: counter
|
8
|
+
<%= link_to_document document, counter: counter %>
|
13
9
|
</h3>
|
10
|
+
<span class='status-icons'>
|
11
|
+
<%= render partial: 'header_icons', locals: { document: document } %>
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
<button
|
14
|
+
class="caret-toggle btn"
|
15
|
+
data-toggle="collapse"
|
16
|
+
data-target="#doc-<%= document.id %>-fields-collapse"
|
17
|
+
aria-label="<%= t('geoblacklight.metadata.toggle_summary') %>"
|
18
|
+
aria-expanded="false"
|
19
|
+
aria-controls="doc-<%= document.id %>-fields-collapse">
|
20
|
+
</button>
|
21
|
+
</span>
|
22
22
|
<% end %>
|
23
|
+
|
24
|
+
<div class='more-info-area'>
|
25
|
+
<div id="doc-<%= document.id %>-fields-collapse" class='collapse'>
|
26
|
+
<small>
|
27
|
+
<%= geoblacklight_present(:index_fields_display, document) %>
|
28
|
+
</small>
|
29
|
+
</div>
|
30
|
+
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= render_help_text_entry('viewer_protocol', document.viewer_protocol) %>
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
<%= content_tag :div, id: 'map', data: { map: 'item', protocol: document.viewer_protocol.camelize, url: document.viewer_endpoint, 'layer-id' => document.wxs_identifier, 'map-bbox' => document.bounding_box_as_wsen, 'catalog-path'=> search_catalog_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } do %>
|
9
|
+
<%= content_tag :div, id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'item', protocol: document.viewer_protocol.camelize, url: document.viewer_endpoint, 'layer-id' => document.wxs_identifier, 'map-bbox' => document.bounding_box_as_wsen, 'catalog-path'=> search_catalog_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } do %>
|
10
10
|
<% end %>
|
11
11
|
</div>
|
12
12
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<%= render partial: 'web_services_default', locals: { reference: reference } %>
|
4
4
|
|
5
|
-
<div class=
|
6
|
-
<label class=
|
7
|
-
<input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class=
|
5
|
+
<div class="form-group form-inline">
|
6
|
+
<label for="wfs_abv_webservice" class="mr-2"><%= t('geoblacklight.references.wfs_abv')%> <code><%= t('geoblacklight.references.wfs_label')%></code></label>
|
7
|
+
<input id="wfs_abv_webservice" type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class="form-control">
|
8
8
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<%= render partial: 'web_services_default', locals: { reference: reference } %>
|
4
4
|
|
5
|
-
<div class=
|
6
|
-
<label class=
|
7
|
-
<input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class=
|
5
|
+
<div class="form-group form-inline">
|
6
|
+
<label for="wms_abv_webservice" class="mr-2"><%= t('geoblacklight.references.wms_abv')%> <code><%= t('geoblacklight.references.wms_label')%></code></label>
|
7
|
+
<input id="wms_abv_webservice" type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class="form-control">
|
8
8
|
</div>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<div class="modal-header">
|
2
|
-
<button type="button" class="ajax-modal-close close" data-dismiss="modal" aria-hidden="true">×</button>
|
3
2
|
<h3 class="modal-title"><%= t('geoblacklight.metadata.view_metadata')%></h3>
|
3
|
+
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
|
4
|
+
<span aria-hidden="true">×</span>
|
5
|
+
</button>
|
4
6
|
</div>
|
5
7
|
<div class="modal-body metadata-body">
|
6
8
|
<%= render partial: 'metadata' %>
|
@@ -1,10 +1,12 @@
|
|
1
1
|
<div class="modal-header">
|
2
|
-
<button type="button" class="ajax-modal-close close" data-dismiss="modal" aria-hidden="true">×</button>
|
3
2
|
<h1 class="modal-title"><%= t('geoblacklight.references.services')%></h1>
|
4
|
-
<
|
5
|
-
|
6
|
-
</
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
|
4
|
+
<span aria-hidden="true">×</span>
|
5
|
+
</button>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<%= render partial: 'web_services' %>
|
9
|
+
</div>
|
10
|
+
<div class="modal-footer">
|
11
|
+
<button type="button" class="btn btn-default hide-without-js" data-dismiss="modal"><%= t('geoblacklight.references.services_close')%></button>
|
10
12
|
</div>
|
@@ -1,10 +1,7 @@
|
|
1
|
-
<li class="list-group-item relations-ancestors">
|
2
|
-
<b><%= t('geoblacklight.relations.ancestor') %></b>
|
3
|
-
</li>
|
4
1
|
<% @relations.ancestors['docs'].each do |ancestor| %>
|
5
|
-
<li class="list-group-item">
|
2
|
+
<li class="list-group-item border-bottom-0">
|
6
3
|
<%= link_to solr_document_path(ancestor['layer_slug_s']) do %>
|
7
|
-
<%=
|
4
|
+
<%= relations_icon(ancestor, 'pagelines-brands') %>
|
8
5
|
<%= ancestor['dc_title_s'] %>
|
9
6
|
<% end %>
|
10
7
|
</li>
|
@@ -1,16 +1,13 @@
|
|
1
|
-
<li class="list-group-item relations-descendants">
|
2
|
-
<b><%= t('geoblacklight.relations.descendant', count: @relations.descendants['numFound']) %></b>
|
3
|
-
</li>
|
4
1
|
<% @relations.descendants['docs'][0..2].each do |descendant| %>
|
5
|
-
<li class="list-group-item">
|
2
|
+
<li class="list-group-item border-bottom-0">
|
6
3
|
<%= link_to solr_document_path(descendant['layer_slug_s']) do %>
|
7
|
-
<%=
|
4
|
+
<%= relations_icon(descendant, 'leaf') %>
|
8
5
|
<%= descendant['dc_title_s'] %>
|
9
6
|
<% end %>
|
10
7
|
</li>
|
11
8
|
<% end %>
|
12
9
|
<% unless (@relations.descendants['numFound'].to_i <= 3) %>
|
13
|
-
<li class="list-group-item">
|
10
|
+
<li class="list-group-item border-bottom-0">
|
14
11
|
<%= link_to search_catalog_path({f: {"#{Settings.FIELDS.SOURCE}" => [@relations.link_id]}}) do %>
|
15
12
|
<%= t('geoblacklight.relations.browse_all', count: @relations.descendants['numFound']) %>
|
16
13
|
<% end %>
|
@@ -1,13 +1,25 @@
|
|
1
1
|
<% unless @relations.empty? %>
|
2
|
-
|
3
|
-
<div class="card
|
4
|
-
|
2
|
+
<% unless @relations.ancestors['numFound'].to_i.zero? %>
|
3
|
+
<div class="card relations">
|
4
|
+
<div class="card-header">
|
5
|
+
<h2 class="mb-0 h6"><%= t('geoblacklight.relations.ancestor') %></h2>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<ul class="list-group list-group-flush">
|
9
|
+
<%= render 'ancestors' %>
|
10
|
+
</ul>
|
5
11
|
</div>
|
12
|
+
<% end %>
|
6
13
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
14
|
+
<% unless @relations.descendants['numFound'].to_i.zero? %>
|
15
|
+
<div class="card relations">
|
16
|
+
<div class="card-header">
|
17
|
+
<h2 class="mb-0 h6"><%= t('geoblacklight.relations.descendant') %></h2>
|
18
|
+
</div>
|
11
19
|
|
12
|
-
|
20
|
+
<ul class="list-group list-group-flush">
|
21
|
+
<%= render 'descendants' %>
|
22
|
+
</ul>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
13
25
|
<% end %>
|