geoblacklight 2.2.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +212 -112
  3. data/.rubocop.yml +16 -14
  4. data/.rubocop_todo.yml +28 -151
  5. data/Gemfile +3 -8
  6. data/README.md +1 -1
  7. data/Rakefile +1 -0
  8. data/app/assets/images/blacklight/arrow-circle-down.svg +1 -2
  9. data/app/assets/images/blacklight/baruch-cuny.svg +1 -4
  10. data/app/assets/images/blacklight/berkeley.svg +1 -4
  11. data/app/assets/images/blacklight/book.svg +1 -4
  12. data/app/assets/images/blacklight/bookmark.svg +1 -4
  13. data/app/assets/images/blacklight/cd-rom.svg +1 -4
  14. data/app/assets/images/blacklight/chicago.svg +1 -4
  15. data/app/assets/images/blacklight/citation.svg +3 -0
  16. data/app/assets/images/blacklight/collection.svg +3 -0
  17. data/app/assets/images/blacklight/columbia.svg +1 -4
  18. data/app/assets/images/blacklight/cornell.svg +1 -4
  19. data/app/assets/images/blacklight/dvd-rom.svg +1 -4
  20. data/app/assets/images/blacklight/email.svg +1 -4
  21. data/app/assets/images/blacklight/esri-globe.svg +1 -4
  22. data/app/assets/images/blacklight/globe.svg +1 -2
  23. data/app/assets/images/blacklight/harvard.svg +1 -4
  24. data/app/assets/images/blacklight/home.svg +1 -2
  25. data/app/assets/images/blacklight/illinois.svg +1 -4
  26. data/app/assets/images/blacklight/image.svg +1 -4
  27. data/app/assets/images/blacklight/indiana.svg +1 -4
  28. data/app/assets/images/blacklight/iowa.svg +1 -4
  29. data/app/assets/images/blacklight/leaf.svg +1 -4
  30. data/app/assets/images/blacklight/lewis-clark.svg +1 -4
  31. data/app/assets/images/blacklight/line.svg +1 -4
  32. data/app/assets/images/blacklight/map-marker.svg +1 -4
  33. data/app/assets/images/blacklight/map.svg +1 -4
  34. data/app/assets/images/blacklight/maryland.svg +1 -4
  35. data/app/assets/images/blacklight/massgis.svg +1 -4
  36. data/app/assets/images/blacklight/metadata.svg +1 -4
  37. data/app/assets/images/blacklight/michigan-state.svg +1 -4
  38. data/app/assets/images/blacklight/michigan.svg +1 -4
  39. data/app/assets/images/blacklight/minnesota.svg +1 -4
  40. data/app/assets/images/blacklight/mit.svg +1 -4
  41. data/app/assets/images/blacklight/mixed.svg +1 -4
  42. data/app/assets/images/blacklight/multilinestring.svg +1 -4
  43. data/app/assets/images/blacklight/multipoint.svg +1 -4
  44. data/app/assets/images/blacklight/multipolygon.svg +1 -4
  45. data/app/assets/images/blacklight/nyu.svg +1 -4
  46. data/app/assets/images/blacklight/ohio-state.svg +1 -4
  47. data/app/assets/images/blacklight/pagelines-brands.svg +1 -4
  48. data/app/assets/images/blacklight/paper-map.svg +1 -4
  49. data/app/assets/images/blacklight/penn-state.svg +1 -4
  50. data/app/assets/images/blacklight/point.svg +1 -4
  51. data/app/assets/images/blacklight/polygon.svg +1 -4
  52. data/app/assets/images/blacklight/polyline.svg +1 -4
  53. data/app/assets/images/blacklight/princeton.svg +1 -4
  54. data/app/assets/images/blacklight/public.svg +1 -4
  55. data/app/assets/images/blacklight/purdue.svg +1 -4
  56. data/app/assets/images/blacklight/raster.svg +1 -4
  57. data/app/assets/images/blacklight/restricted.svg +1 -4
  58. data/app/assets/images/blacklight/sms.svg +1 -4
  59. data/app/assets/images/blacklight/stanford.svg +1 -4
  60. data/app/assets/images/blacklight/table.svg +1 -4
  61. data/app/assets/images/blacklight/tags.svg +1 -2
  62. data/app/assets/images/blacklight/texas.svg +1 -4
  63. data/app/assets/images/blacklight/tufts.svg +1 -4
  64. data/app/assets/images/blacklight/ucla.svg +1 -4
  65. data/app/assets/images/blacklight/uva.svg +1 -4
  66. data/app/assets/images/blacklight/web_services.svg +1 -4
  67. data/app/assets/images/blacklight/wisconsin.svg +1 -4
  68. data/app/assets/javascripts/geoblacklight/basemaps.js +18 -0
  69. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  70. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +1 -1
  71. data/app/assets/javascripts/geoblacklight/modules/home.js +1 -1
  72. data/app/assets/javascripts/geoblacklight/modules/item.js +20 -1
  73. data/app/assets/javascripts/geoblacklight/modules/results.js +4 -2
  74. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +31 -0
  75. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -2
  76. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +1 -1
  77. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
  78. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +2 -0
  79. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +33 -0
  80. data/app/assets/stylesheets/geoblacklight/{_blacklight_overrides.scss → modules/_blacklight_overrides.scss} +1 -10
  81. data/app/assets/stylesheets/geoblacklight/{_styles.scss → modules/_styles.scss} +1 -0
  82. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +37 -54
  83. data/app/assets/stylesheets/geoblacklight/modules/item.scss +13 -0
  84. data/app/assets/stylesheets/geoblacklight/modules/results.scss +26 -29
  85. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +12 -42
  86. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +17 -59
  87. data/app/controllers/download_controller.rb +12 -12
  88. data/app/controllers/relation_controller.rb +1 -0
  89. data/app/controllers/wms_controller.rb +1 -0
  90. data/app/helpers/arcgis_helper.rb +1 -0
  91. data/app/helpers/blacklight_helper.rb +1 -0
  92. data/app/helpers/carto_helper.rb +1 -0
  93. data/app/helpers/geoblacklight_helper.rb +36 -79
  94. data/app/models/concerns/geoblacklight/solr_document.rb +15 -9
  95. data/app/models/concerns/geoblacklight/solr_document/arcgis.rb +2 -1
  96. data/app/models/concerns/geoblacklight/solr_document/carto.rb +1 -13
  97. data/app/models/concerns/geoblacklight/solr_document/citation.rb +29 -0
  98. data/app/models/concerns/geoblacklight/solr_document/finder.rb +1 -0
  99. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +2 -1
  100. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -1
  101. data/app/presenters/geoblacklight/document_presenter.rb +2 -1
  102. data/app/views/catalog/_arcgis.html.erb +4 -0
  103. data/app/views/catalog/_carto.html.erb +4 -0
  104. data/app/views/catalog/_citation.html.erb +11 -0
  105. data/app/views/catalog/_data_dictionary.html.erb +1 -1
  106. data/app/views/catalog/_document_action.html.erb +1 -1
  107. data/app/views/catalog/_document_split.html.erb +1 -1
  108. data/app/views/catalog/_downloads_primary.html.erb +8 -1
  109. data/app/views/catalog/_header_icons.html.erb +3 -3
  110. data/app/views/catalog/_home_text.html.erb +4 -1
  111. data/app/views/catalog/_index_split_default.html.erb +22 -14
  112. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  113. data/app/views/catalog/_web_services_wfs.html.erb +3 -3
  114. data/app/views/catalog/_web_services_wms.html.erb +3 -3
  115. data/app/views/catalog/metadata.html.erb +3 -1
  116. data/app/views/catalog/web_services.html.erb +9 -7
  117. data/app/views/relation/_ancestors.html.erb +2 -5
  118. data/app/views/relation/_descendants.html.erb +3 -6
  119. data/app/views/relation/index.html.erb +20 -8
  120. data/app/views/relation/index.json.jbuilder +2 -1
  121. data/app/views/shared/_header_navbar.html.erb +1 -3
  122. data/bin/coverage.rb +36 -0
  123. data/config/initializers/rails_config.rb +1 -0
  124. data/config/locales/geoblacklight.en.yml +46 -61
  125. data/geoblacklight.gemspec +5 -8
  126. data/lib/generators/geoblacklight/assets_generator.rb +46 -0
  127. data/lib/generators/geoblacklight/install_generator.rb +8 -9
  128. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +1 -0
  129. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +28 -0
  130. data/{app/assets/stylesheets/geoblacklight/application.scss → lib/generators/geoblacklight/templates/assets/_geoblacklight.scss} +0 -1
  131. data/lib/generators/geoblacklight/templates/assets/application.scss +7 -0
  132. data/lib/generators/geoblacklight/templates/{geoblacklight.js → assets/geoblacklight.js} +0 -1
  133. data/lib/generators/geoblacklight/templates/catalog_controller.rb +6 -2
  134. data/lib/generators/geoblacklight/templates/settings.yml +4 -6
  135. data/lib/generators/geoblacklight/webpacker_generator.rb +2 -1
  136. data/lib/geoblacklight.rb +1 -0
  137. data/lib/geoblacklight/bounding_box.rb +1 -0
  138. data/lib/geoblacklight/catalog_helper_override.rb +2 -1
  139. data/lib/geoblacklight/constants.rb +1 -0
  140. data/lib/geoblacklight/download.rb +6 -5
  141. data/lib/geoblacklight/download/geojson_download.rb +1 -0
  142. data/lib/geoblacklight/download/geotiff_download.rb +1 -0
  143. data/lib/geoblacklight/download/hgl_download.rb +1 -0
  144. data/lib/geoblacklight/download/kmz_download.rb +2 -1
  145. data/lib/geoblacklight/download/shapefile_download.rb +1 -0
  146. data/lib/geoblacklight/engine.rb +2 -2
  147. data/lib/geoblacklight/exceptions.rb +1 -0
  148. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +1 -0
  149. data/lib/geoblacklight/item_viewer.rb +1 -0
  150. data/lib/geoblacklight/metadata.rb +1 -0
  151. data/lib/geoblacklight/metadata/base.rb +3 -2
  152. data/lib/geoblacklight/metadata/fgdc.rb +1 -0
  153. data/lib/geoblacklight/metadata/html.rb +2 -2
  154. data/lib/geoblacklight/metadata/iso19139.rb +1 -0
  155. data/lib/geoblacklight/metadata_transformer.rb +1 -0
  156. data/lib/geoblacklight/metadata_transformer/base.rb +1 -0
  157. data/lib/geoblacklight/metadata_transformer/fgdc.rb +1 -0
  158. data/lib/geoblacklight/metadata_transformer/iso19139.rb +1 -0
  159. data/lib/geoblacklight/reference.rb +1 -0
  160. data/lib/geoblacklight/references.rb +7 -3
  161. data/lib/geoblacklight/relation/ancestors.rb +2 -1
  162. data/lib/geoblacklight/relation/descendants.rb +2 -1
  163. data/lib/geoblacklight/relation/relation_response.rb +2 -1
  164. data/lib/geoblacklight/routes.rb +1 -0
  165. data/lib/geoblacklight/routes/downloadable.rb +1 -0
  166. data/lib/geoblacklight/routes/exportable.rb +1 -0
  167. data/lib/geoblacklight/routes/wms.rb +1 -0
  168. data/lib/geoblacklight/version.rb +2 -1
  169. data/lib/geoblacklight/view_helper_override.rb +2 -1
  170. data/lib/geoblacklight/wms_layer.rb +3 -2
  171. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -0
  172. data/lib/tasks/geoblacklight.rake +33 -32
  173. data/solr/conf/schema.xml +5 -5
  174. data/spec/controllers/catalog_controller_spec.rb +1 -0
  175. data/spec/controllers/download_controller_spec.rb +2 -1
  176. data/spec/controllers/relation_controller_spec.rb +1 -0
  177. data/spec/controllers/wms_controller_spec.rb +2 -1
  178. data/spec/factories/user.rb +1 -0
  179. data/spec/features/bookmarks_spec.rb +1 -0
  180. data/spec/features/configurable_basemap_spec.rb +10 -0
  181. data/spec/features/data_dictionary_download_spec.rb +1 -0
  182. data/spec/features/download_layer_spec.rb +1 -0
  183. data/spec/features/empty_search_spec.rb +1 -0
  184. data/spec/features/esri_viewer_spec.rb +1 -6
  185. data/spec/features/exports_spec.rb +4 -12
  186. data/spec/features/help_text_spec.rb +1 -0
  187. data/spec/features/home_page_spec.rb +6 -0
  188. data/spec/features/iiif_viewer_spec.rb +1 -0
  189. data/spec/features/index_map_spec.rb +1 -0
  190. data/spec/features/layer_inspection_spec.rb +1 -0
  191. data/spec/features/layer_opacity_spec.rb +1 -0
  192. data/spec/features/layer_preview_spec.rb +1 -0
  193. data/spec/features/layer_with_no_references_spec.rb +1 -0
  194. data/spec/features/linkified_attribute_table_spec.rb +1 -0
  195. data/spec/features/metadata_panel_spec.rb +1 -0
  196. data/spec/features/missing_metadata_spec.rb +13 -0
  197. data/spec/features/multiple_downloads_spec.rb +15 -0
  198. data/spec/features/oembed_spec.rb +1 -0
  199. data/spec/features/relations_spec.rb +10 -28
  200. data/spec/features/saved_searches_spec.rb +1 -0
  201. data/spec/features/search_bar_spec.rb +1 -0
  202. data/spec/features/search_results_map_spec.rb +1 -6
  203. data/spec/features/search_results_overlap_ratio_spec.rb +4 -3
  204. data/spec/features/search_spec.rb +1 -0
  205. data/spec/features/show_page_metadata_spec.rb +1 -0
  206. data/spec/features/sms_spec.rb +1 -0
  207. data/spec/features/split_view.html.erb_spec.rb +4 -3
  208. data/spec/features/suppressed_records_spec.rb +1 -0
  209. data/spec/features/web_services_modal_spec.rb +1 -0
  210. data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +30 -0
  211. data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +17 -0
  212. data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +23 -0
  213. data/spec/fixtures/solr_documents/multiple-downloads.json +30 -0
  214. data/spec/helpers/arcgis_helper_spec.rb +1 -0
  215. data/spec/helpers/carto_helper_spec.rb +1 -0
  216. data/spec/helpers/geoblacklight_helper_spec.rb +51 -5
  217. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +12 -0
  218. data/spec/javascripts/geoblacklight_spec.js +0 -4
  219. data/spec/lib/geoblacklight/bounding_box_spec.rb +1 -0
  220. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -0
  221. data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -2
  222. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -0
  223. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -0
  224. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -0
  225. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -0
  226. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -0
  227. data/spec/lib/geoblacklight/download_spec.rb +4 -3
  228. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  229. data/spec/lib/geoblacklight/item_viewer_spec.rb +1 -0
  230. data/spec/lib/geoblacklight/metadata/base_spec.rb +4 -3
  231. data/spec/lib/geoblacklight/metadata/html_spec.rb +1 -0
  232. data/spec/lib/geoblacklight/metadata_spec.rb +1 -0
  233. data/spec/lib/geoblacklight/metadata_transformer/base_spec.rb +3 -2
  234. data/spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb +3 -2
  235. data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +3 -2
  236. data/spec/lib/geoblacklight/metadata_transformer_spec.rb +4 -3
  237. data/spec/lib/geoblacklight/reference_spec.rb +1 -0
  238. data/spec/lib/geoblacklight/references_spec.rb +2 -3
  239. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +2 -1
  240. data/spec/lib/geoblacklight/relation/descendants_spec.rb +2 -1
  241. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +1 -0
  242. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -0
  243. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -4
  244. data/spec/lib/geoblacklight/wms_layer_spec.rb +3 -2
  245. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +1 -20
  246. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +14 -0
  247. data/spec/models/concerns/geoblacklight/solr_document/finder_spec.rb +1 -0
  248. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +1 -0
  249. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +27 -0
  250. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +15 -2
  251. data/spec/routing/catalog_routing_spec.rb +1 -0
  252. data/spec/spec_helper.rb +12 -9
  253. data/spec/support/backport_test_helpers.rb +1 -0
  254. data/spec/support/features.rb +1 -0
  255. data/spec/support/features/session_helpers.rb +1 -0
  256. data/spec/support/fixtures.rb +8 -0
  257. data/spec/tasks/geoblacklight_spec.rb +19 -0
  258. data/spec/teaspoon_env.rb +1 -0
  259. data/spec/test_app_templates/Gemfile.extra +1 -0
  260. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -0
  261. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -0
  262. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -0
  263. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +1 -0
  264. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -0
  265. data/spec/views/catalog/_show_tools.html.erb_spec.rb +2 -4
  266. data/template.rb +1 -0
  267. data/vendor/assets/stylesheets/leaflet.css +0 -1
  268. metadata +69 -79
  269. data/app/assets/images/blacklight/logo.png +0 -0
  270. data/app/assets/javascripts/geoblacklight/modules/collapse.js +0 -7
  271. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +0 -36
  272. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +0 -15
  273. data/app/views/catalog/_exports.html.erb +0 -3
  274. data/app/views/catalog/_show_tools.html.erb +0 -25
  275. data/lib/generators/geoblacklight/templates/geoblacklight.scss +0 -4
  276. data/vendor/assets/javascripts/readmore.js +0 -618
  277. 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
- fetch(Settings.FIELDS.RIGHTS).casecmp('public').zero?
22
+ rights_field_data.present? && rights_field_data.casecmp('public').zero?
21
23
  end
22
24
 
23
25
  def restricted?
24
- fetch(Settings.FIELDS.RIGHTS).casecmp('restricted').zero?
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 unless references.download.blank?
38
+ references.download.to_hash if references.download.present?
37
39
  end
38
40
 
39
41
  def hgl_download
40
- references.hgl.to_hash unless references.hgl.blank?
42
+ references.hgl.to_hash if references.hgl.present?
41
43
  end
42
44
 
43
45
  def oembed
44
- references.oembed.endpoint unless references.oembed.blank?
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 unless references.iiif.blank?
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 unless references.data_dictionary.blank?
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$/ =~ method.to_s
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 unless references.esri_webservices.present?
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
  ##
@@ -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(wms feature_layer dynamic_map_layer tiled_map_layer)
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] = "$overlap^#{Settings.OVERLAP_RATIO_BOOST}"
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
- unless val.blank?
16
+ if val.present?
16
17
  val += '.' unless val.end_with?('.')
17
18
  fields_values << val
18
19
  end
@@ -0,0 +1,4 @@
1
+ <% document ||= @document %>
2
+ <%= link_to(arcgis_link(document.arcgis_urls)) do %>
3
+ <%= blacklight_icon('esri-globe') %> <%= t('geoblacklight.tools.open_arcgis') %>
4
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <% document ||= @document %>
2
+ <%= link_to carto_link(document.carto_reference), target: '_blank' do %>
3
+ <span class='geoblacklight geoblacklight-carto'></span><%= t('geoblacklight.tools.open_carto') %>
4
+ <% 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">&times;</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
- <%= render partial: 'download_link', locals: { download_link: download_link_direct(download_text(document.file_format), document) } %>
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
- <div class='status-icons'>
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, title: document[blacklight_config.index.title_field] %>
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
- <div class='col-md-12 more-info-area'>
16
- <div class='collapse' data-collapse-target="<%= document.id %>">
17
- <small>
18
- <%= geoblacklight_present(:index_fields_display, document) %>
19
- </small>
20
- </div>
21
- </div>
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='form-group form-inline'>
6
- <label class='control-label'><%= t('geoblacklight.references.wfs_abv')%> <code><%= t('geoblacklight.references.wfs_label')%></code></label>
7
- <input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
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='form-group form-inline'>
6
- <label class='control-label'><%= t('geoblacklight.references.wms_abv')%> <code><%= t('geoblacklight.references.wms_label')%></code></label>
7
- <input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
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">&times;</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
- <div class="modal-body">
5
- <%= render partial: 'web_services' %>
6
- </div>
7
- <div class="modal-footer">
8
- <button type="button" class="btn btn-default hide-without-js" data-dismiss="modal"><%= t('geoblacklight.references.services_close')%></button>
9
- </div>
3
+ <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
4
+ <span aria-hidden="true">&times;</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
- <%= geoblacklight_icon('pagelines-brands') %>
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
- <%= geoblacklight_icon('leaf') %>
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
- <div class="card relations">
3
- <div class="card-header">
4
- <%= t('geoblacklight.relations.title') %>
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
- <ul class="list-group list-group-flush">
8
- <%= render 'ancestors' unless @relations.ancestors['numFound'].to_i == 0 %>
9
- <%= render 'descendants' unless @relations.descendants['numFound'].to_i == 0 %>
10
- </ul>
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
- </div>
20
+ <ul class="list-group list-group-flush">
21
+ <%= render 'descendants' %>
22
+ </ul>
23
+ </div>
24
+ <% end %>
13
25
  <% end %>