geoblacklight 3.2.0 → 4.0.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +148 -0
  3. data/.gitignore +8 -0
  4. data/.rubocop.yml +14 -10
  5. data/.rubocop_todo.yml +361 -26
  6. data/README.md +3 -3
  7. data/Rakefile +19 -12
  8. data/app/assets/images/blacklight/michigan-state-university.svg +6 -0
  9. data/app/assets/images/blacklight/pennsylvania-state-university.svg +6 -0
  10. data/app/assets/images/blacklight/purdue-university.svg +6 -0
  11. data/app/assets/images/blacklight/the-ohio-state-university.svg +7 -0
  12. data/app/assets/images/blacklight/university-of-chicago.svg +6 -0
  13. data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +6 -0
  14. data/app/assets/images/blacklight/university-of-iowa.svg +5 -0
  15. data/app/assets/images/blacklight/university-of-maryland.svg +5 -0
  16. data/app/assets/images/blacklight/university-of-michigan.svg +5 -0
  17. data/app/assets/images/blacklight/university-of-minnesota.svg +5 -0
  18. data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +8 -0
  19. data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +5 -0
  20. data/app/assets/images/favicon.ico +0 -0
  21. data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
  22. data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
  23. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
  24. data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
  25. data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
  26. data/app/assets/javascripts/geoblacklight/viewers/esri.js +1 -1
  27. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
  28. data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
  29. data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
  30. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
  31. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +41 -0
  32. data/app/assets/stylesheets/geoblacklight/modules/results.scss +1 -1
  33. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +6 -0
  34. data/app/components/geoblacklight/homepage_feature_facet_component.html.erb +11 -0
  35. data/app/components/geoblacklight/homepage_feature_facet_component.rb +13 -0
  36. data/{lib → app/helpers}/geoblacklight/geoblacklight_helper_behavior.rb +6 -4
  37. data/app/helpers/geoblacklight_helper.rb +14 -8
  38. data/app/models/concerns/geoblacklight/solr_document/citation.rb +2 -2
  39. data/app/models/concerns/geoblacklight/solr_document.rb +11 -16
  40. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +5 -5
  41. data/app/views/catalog/_arcgis.html.erb +1 -1
  42. data/app/views/catalog/_data_dictionary.html.erb +1 -2
  43. data/app/views/catalog/_document_split.html.erb +1 -1
  44. data/app/views/catalog/_header_icons.html.erb +1 -1
  45. data/app/views/catalog/_home_text.html.erb +7 -29
  46. data/app/views/catalog/_index_split_default.html.erb +1 -1
  47. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  48. data/app/views/catalog/_show_header_default.html.erb +1 -1
  49. data/app/views/download/hgl.html.erb +13 -11
  50. data/app/views/relation/_relations.html.erb +15 -0
  51. data/app/views/relation/index.html.erb +4 -16
  52. data/app/views/relation/index.json.jbuilder +6 -2
  53. data/babel.config.json +4 -0
  54. data/config/initializers/new_gbl_settings_defaults_3_4.yml +6 -0
  55. data/config/locales/geoblacklight.en.yml +12 -0
  56. data/geoblacklight.gemspec +5 -3
  57. data/jest.config.js +25 -0
  58. data/lib/generators/geoblacklight/install_generator.rb +1 -1
  59. data/lib/generators/geoblacklight/templates/catalog_controller.rb +78 -35
  60. data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +195 -0
  61. data/lib/generators/geoblacklight/templates/settings.yml +91 -17
  62. data/lib/geoblacklight/bounding_box.rb +1 -1
  63. data/lib/geoblacklight/constants.rb +1 -0
  64. data/lib/geoblacklight/download/geojson_download.rb +1 -1
  65. data/lib/geoblacklight/download/geotiff_download.rb +1 -1
  66. data/lib/geoblacklight/download/hgl_download.rb +1 -1
  67. data/lib/geoblacklight/download/kmz_download.rb +2 -2
  68. data/lib/geoblacklight/download/shapefile_download.rb +1 -1
  69. data/lib/geoblacklight/geometry.rb +85 -0
  70. data/lib/geoblacklight/item_viewer.rb +5 -1
  71. data/lib/geoblacklight/metadata/base.rb +1 -7
  72. data/lib/geoblacklight/references.rb +1 -1
  73. data/lib/geoblacklight/relation/ancestors.rb +4 -3
  74. data/lib/geoblacklight/relation/descendants.rb +4 -3
  75. data/lib/geoblacklight/relation/relation_response.rb +21 -6
  76. data/lib/geoblacklight/version.rb +1 -1
  77. data/lib/geoblacklight/view_helper_override.rb +1 -1
  78. data/lib/geoblacklight/wms_layer.rb +1 -4
  79. data/lib/geoblacklight.rb +1 -3
  80. data/lib/tasks/geoblacklight.rake +5 -0
  81. data/package.json +17 -1
  82. data/schema/{geoblacklight-schema.json → geoblacklight-schema-1.0.json} +1 -1
  83. data/schema/geoblacklight-schema-aardvark.json +211 -0
  84. data/setupJest.js +14 -0
  85. data/solr/conf/schema.xml +35 -29
  86. data/solr/conf/solrconfig.xml +15 -15
  87. data/spec/components/geoblacklight/homepage_feature_facet_component_spec.rb +39 -0
  88. data/spec/config/initializers/rails_config_spec.rb +15 -0
  89. data/spec/controllers/catalog_controller_spec.rb +7 -7
  90. data/spec/features/esri_viewer_spec.rb +1 -1
  91. data/spec/features/home_page_spec.rb +4 -4
  92. data/spec/features/layer_opacity_spec.rb +1 -0
  93. data/spec/features/metadata_panel_spec.rb +1 -1
  94. data/spec/features/missing_metadata_spec.rb +2 -2
  95. data/spec/features/relations_spec.rb +2 -2
  96. data/spec/features/search_results_map_spec.rb +2 -1
  97. data/spec/features/search_results_overlap_ratio_spec.rb +2 -2
  98. data/spec/features/split_view.html.erb_spec.rb +16 -12
  99. data/spec/features/tms_spec.rb +10 -0
  100. data/spec/fixtures/solr_documents/README.md +48 -36
  101. data/spec/fixtures/solr_documents/actual-papermap1.json +41 -18
  102. data/spec/fixtures/solr_documents/actual-point1.json +47 -27
  103. data/spec/fixtures/solr_documents/actual-polygon1.json +43 -18
  104. data/spec/fixtures/solr_documents/actual-raster1.json +52 -23
  105. data/spec/fixtures/solr_documents/all-relationships.json +48 -0
  106. data/spec/fixtures/solr_documents/baruch_ancestor1.json +62 -37
  107. data/spec/fixtures/solr_documents/baruch_ancestor2.json +62 -37
  108. data/spec/fixtures/solr_documents/baruch_documentation_download.json +60 -34
  109. data/spec/fixtures/solr_documents/bbox-spans-180.json +34 -16
  110. data/spec/fixtures/solr_documents/cornell_html_metadata.json +46 -26
  111. data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +43 -25
  112. data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +45 -28
  113. data/spec/fixtures/solr_documents/esri-feature-layer.json +44 -34
  114. data/spec/fixtures/solr_documents/esri-image-map-layer.json +45 -31
  115. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +42 -17
  116. data/spec/fixtures/solr_documents/esri-wms-layer.json +46 -21
  117. data/spec/fixtures/solr_documents/harvard_raster.json +55 -36
  118. data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +35 -22
  119. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +48 -27
  120. data/spec/fixtures/solr_documents/index-map-polygon.json +48 -27
  121. data/spec/fixtures/solr_documents/index-map-stanford.json +54 -25
  122. data/spec/fixtures/solr_documents/index_map_point.json +54 -26
  123. data/spec/fixtures/solr_documents/metadata_no_geom.json +27 -0
  124. data/spec/fixtures/solr_documents/metadata_no_provider.json +39 -0
  125. data/spec/fixtures/solr_documents/multiple-downloads.json +33 -20
  126. data/spec/fixtures/solr_documents/no_locn_geometry.json +25 -0
  127. data/spec/fixtures/solr_documents/no_spatial.json +37 -19
  128. data/spec/fixtures/solr_documents/oembed.json +34 -17
  129. data/spec/fixtures/solr_documents/princeton-child1.json +45 -28
  130. data/spec/fixtures/solr_documents/princeton-child2.json +45 -28
  131. data/spec/fixtures/solr_documents/princeton-child3.json +45 -28
  132. data/spec/fixtures/solr_documents/princeton-child4.json +45 -28
  133. data/spec/fixtures/solr_documents/princeton-parent.json +46 -23
  134. data/spec/fixtures/solr_documents/public_direct_download.json +48 -21
  135. data/spec/fixtures/solr_documents/public_iiif_princeton.json +49 -24
  136. data/spec/fixtures/solr_documents/public_polygon_mit.json +31 -15
  137. data/spec/fixtures/solr_documents/restricted-line.json +52 -21
  138. data/spec/fixtures/solr_documents/the-related-record.json +27 -0
  139. data/spec/fixtures/solr_documents/tms.json +45 -0
  140. data/spec/fixtures/solr_documents/umn_metro_result1.json +44 -28
  141. data/spec/fixtures/solr_documents/umn_state_result1.json +44 -26
  142. data/spec/fixtures/solr_documents/umn_state_result2.json +45 -24
  143. data/spec/fixtures/solr_documents/uva_slug_colon.json +43 -20
  144. data/spec/{lib → helpers}/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -0
  145. data/spec/helpers/geoblacklight_helper_spec.rb +30 -4
  146. data/spec/javascripts/geoblacklight_spec.js +0 -6
  147. data/spec/javascripts/metadata_download_button_spec.js +5 -3
  148. data/spec/javascripts/util_spec.js +2 -4
  149. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -1
  150. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -1
  151. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +1 -1
  152. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +2 -2
  153. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -1
  154. data/spec/lib/geoblacklight/download_spec.rb +1 -1
  155. data/spec/lib/geoblacklight/geometry_spec.rb +59 -0
  156. data/spec/lib/geoblacklight/item_viewer_spec.rb +12 -0
  157. data/spec/lib/geoblacklight/references_spec.rb +3 -3
  158. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +3 -3
  159. data/spec/lib/geoblacklight/relation/descendants_spec.rb +3 -3
  160. data/spec/lib/geoblacklight/relation/relation_response_spec.rb +32 -17
  161. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +4 -4
  162. data/spec/spec_helper.rb +2 -0
  163. data/spec/support/view_component_capybara_test_helpers.rb +8 -0
  164. data/spec/test_app_templates/Gemfile.extra +1 -0
  165. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -7
  166. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
  167. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
  168. data/template.rb +1 -0
  169. metadata +99 -51
  170. data/.circleci/config.yml +0 -256
  171. data/app/views/catalog/_document_action.html.erb +0 -6
  172. data/app/views/catalog/_facet_tag_item.html.erb +0 -3
  173. data/app/views/catalog/_facet_tag_layout.html.erb +0 -2
  174. data/app/views/relation/_ancestors.html.erb +0 -8
  175. data/app/views/relation/_descendants.html.erb +0 -15
  176. data/schema/format-values.md +0 -50
  177. data/schema/geoblacklight-schema-deprecated.md +0 -39
  178. data/schema/geoblacklight-schema.md +0 -323
  179. data/schema/geometry-type-values.md +0 -11
  180. data/schema/references.md +0 -23
  181. data/schema/schema-commentary.md +0 -198
  182. data/schema/subjects.md +0 -41
  183. data/schema/type-values.md +0 -10
  184. data/spec/fixtures/solr_documents/metadata_no_dct_provenance_s.json +0 -30
  185. data/spec/fixtures/solr_documents/metadata_no_layer_geom_type_s.json +0 -17
  186. data/spec/fixtures/solr_documents/metadata_no_solr_geom.json +0 -23
  187. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +0 -12
  188. data/spec/javascripts/spec_helper.js +0 -32
  189. data/spec/lib/geoblacklight/controller_override_spec.rb +0 -2
  190. data/spec/teaspoon_env.rb +0 -214
@@ -0,0 +1,11 @@
1
+ <div class='category-block col-sm'>
2
+ <div class='category-icon'>
3
+ <%= geoblacklight_icon(@icon) %>
4
+ </div>
5
+ <%= content_tag :h4, t(@label) %>
6
+ <%- facets = @response.aggregations[@facet_field].items.map { |item|
7
+ link_to(item.value, search_catalog_path("f[#{@facet_field}][]": item.value), class: 'home-facet-link')
8
+ } %>
9
+ <%- facets << link_to('more »', facet_catalog_path(@facet_field), class: 'more_facets_link') %>
10
+ <%= facets.join(', ').html_safe %>
11
+ </div>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Geoblacklight
4
+ class HomepageFeatureFacetComponent < ViewComponent::Base
5
+ def initialize(icon:, label:, facet_field:, response:)
6
+ @icon = icon
7
+ @label = label
8
+ @facet_field = facet_field
9
+ @response = response
10
+ super
11
+ end
12
+ end
13
+ end
@@ -1,15 +1,17 @@
1
1
  # frozen_string_literal: true
2
+ ##
3
+ # Adds helper behavior logic for GeoBlacklight, to used alongside
4
+ # BlacklightHelperBehavior
2
5
  module Geoblacklight
3
- ##
4
- # Adds helper behavior logic for GeoBlacklight, to used alongside
5
- # BlacklightHelperBehavior
6
6
  module GeoblacklightHelperBehavior
7
+ include Blacklight::BlacklightHelperBehavior
8
+
7
9
  ##
8
10
  # Calls the presenter on the requested method
9
11
  # @param [Symbol, String] presenting_method
10
12
  # @return [String]
11
13
  def geoblacklight_present(presenting_method, document = @document)
12
- presenter(document).try(presenting_method.to_sym) || ''
14
+ document_presenter(document).try(presenting_method.to_sym) || ''
13
15
  end
14
16
  end
15
17
  end
@@ -91,12 +91,6 @@ module GeoblacklightHelper
91
91
  truncate(Array(args[:value]).flatten.join(' '), length: 150)
92
92
  end
93
93
 
94
- def render_facet_tags(facet)
95
- render_facet_limit(facets_from_request(facet).first,
96
- partial: 'facet_tag_item',
97
- layout: 'facet_tag_layout')
98
- end
99
-
100
94
  ##
101
95
  # Returns an SVG icon or empty HTML span element
102
96
  # @return [SVG or HTML tag]
@@ -173,7 +167,7 @@ module GeoblacklightHelper
173
167
  if I18n.exists?("geoblacklight.help_text.#{feature}.#{key}", locale)
174
168
  help_text = I18n.t("geoblacklight.help_text.#{feature}.#{key}")
175
169
  tag.h3 class: 'help-text viewer_protocol h6' do
176
- tag.a 'data': { toggle: 'popover', title: help_text[:title], content: help_text[:content] } do
170
+ tag.a data: { toggle: 'popover', title: help_text[:title], content: help_text[:content] } do
177
171
  help_text[:title]
178
172
  end
179
173
  end
@@ -280,6 +274,18 @@ module GeoblacklightHelper
280
274
  icon_name = icon if icon_name.blank?
281
275
  icon_options = {}
282
276
  icon_options = { classes: 'svg_tooltip' } if Settings.USE_GEOM_FOR_RELATIONS_ICON
283
- geoblacklight_icon(icon_name, icon_options)
277
+ geoblacklight_icon(icon_name, **icon_options)
278
+ end
279
+
280
+ ## Returns the data-map attribute value used as the JS map selector
281
+ def results_js_map_selector(controller_name)
282
+ case controller_name
283
+ when 'bookmarks'
284
+ 'bookmarks'
285
+ when 'catalog'
286
+ 'index'
287
+ else
288
+ 'index'
289
+ end
284
290
  end
285
291
  end
@@ -18,11 +18,11 @@ module Geoblacklight
18
18
  private
19
19
 
20
20
  def issued
21
- fetch(Settings.FIELDS.ISSUED, nil)
21
+ fetch(Settings.FIELDS.DATE_ISSUED, nil)
22
22
  end
23
23
 
24
24
  def format
25
- fetch(Settings.FIELDS.FILE_FORMAT, nil)
25
+ fetch(Settings.FIELDS.FORMAT, nil)
26
26
  end
27
27
  end
28
28
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Geoblacklight
3
- # Extends Blacklight::Solr::Document for GeoBlacklight specific functionalit
4
+ # Extends Blacklight::Solr::Document for GeoBlacklight specific functionality
4
5
  module SolrDocument
5
6
  extend Blacklight::Solr::Document
6
7
 
@@ -47,7 +48,7 @@ module Geoblacklight
47
48
  end
48
49
 
49
50
  def same_institution?
50
- fetch(Settings.FIELDS.PROVENANCE, '').casecmp(Settings.INSTITUTION.downcase).zero?
51
+ fetch(Settings.FIELDS.PROVIDER, '').casecmp(Settings.INSTITUTION.downcase).zero?
51
52
  end
52
53
 
53
54
  def iiif_download
@@ -70,18 +71,12 @@ module Geoblacklight
70
71
  'http://schema.org/Dataset'
71
72
  end
72
73
 
73
- def bounding_box_as_wsen
74
- geom_field = fetch(Settings.FIELDS.GEOMETRY, '')
75
- exp = /^\s*ENVELOPE\(
76
- \s*([-\.\d]+)\s*,
77
- \s*([-\.\d]+)\s*,
78
- \s*([-\.\d]+)\s*,
79
- \s*([-\.\d]+)\s*
80
- \)\s*$/x # uses 'x' option for free-spacing mode
81
- bbox_match = exp.match(geom_field)
82
- return geom_field unless bbox_match # return as-is, not a WKT
83
- w, e, n, s = bbox_match.captures
84
- "#{w} #{s} #{e} #{n}"
74
+ def geom_field
75
+ fetch(Settings.FIELDS.SPATIAL_EXTENT, '')
76
+ end
77
+
78
+ def geometry
79
+ @geometry ||= Geoblacklight::Geometry.new(geom_field)
85
80
  end
86
81
 
87
82
  def wxs_identifier
@@ -89,7 +84,7 @@ module Geoblacklight
89
84
  end
90
85
 
91
86
  def file_format
92
- fetch(Settings.FIELDS.FILE_FORMAT)
87
+ fetch(Settings.FIELDS.FORMAT)
93
88
  end
94
89
 
95
90
  ##
@@ -105,7 +100,7 @@ module Geoblacklight
105
100
  private
106
101
 
107
102
  def rights_field_data
108
- fetch(Settings.FIELDS.RIGHTS, '')
103
+ fetch(Settings.FIELDS.ACCESS_RIGHTS, '')
109
104
  end
110
105
 
111
106
  def method_missing(method, *args, &block)
@@ -16,14 +16,14 @@ module Geoblacklight
16
16
  def add_spatial_params(solr_params)
17
17
  if blacklight_params[:bbox]
18
18
  solr_params[:bq] ||= []
19
- solr_params[:bq] << "#{Settings.FIELDS.GEOMETRY}:\"IsWithin(#{envelope_bounds})\"#{boost}"
19
+ solr_params[:bq] << "#{Settings.FIELDS.SPATIAL_EXTENT}:\"IsWithin(#{envelope_bounds})\"#{boost}"
20
20
  solr_params[:fq] ||= []
21
- solr_params[:fq] << "#{Settings.FIELDS.GEOMETRY}:\"Intersects(#{envelope_bounds})\""
21
+ solr_params[:fq] << "#{Settings.FIELDS.SPATIAL_EXTENT}:\"Intersects(#{envelope_bounds})\""
22
22
 
23
23
  if Settings.OVERLAP_RATIO_BOOST
24
24
  solr_params[:bf] ||= []
25
25
  solr_params[:overlap] =
26
- "{!field uf=* defType=lucene f=solr_bboxtype score=overlapRatio}Intersects(#{envelope_bounds})"
26
+ "{!field uf=* defType=lucene f=#{Settings.FIELDS.OVERLAP_FIELD} score=overlapRatio}Intersects(#{envelope_bounds})"
27
27
  solr_params[:bf] << "$overlap^#{Settings.OVERLAP_RATIO_BOOST}"
28
28
  end
29
29
  end
@@ -62,10 +62,10 @@ module Geoblacklight
62
62
 
63
63
  # Do not suppress action_documents method calls for individual documents
64
64
  # ex. CatalogController#web_services (exportable views)
65
- return if solr_params[:q]&.include?('{!lucene}layer_slug_s:')
65
+ return if solr_params[:q]&.include?("{!lucene}#{Settings.FIELDS.ID}:")
66
66
 
67
67
  solr_params[:fq] ||= []
68
- solr_params[:fq] << '-suppressed_b: true'
68
+ solr_params[:fq] << "-#{Settings.FIELDS.SUPPRESSED}: true"
69
69
  end
70
70
  end
71
71
  end
@@ -1,4 +1,4 @@
1
1
  <% document ||= @document %>
2
2
  <%= link_to(arcgis_link(document.arcgis_urls)) do %>
3
- <%= blacklight_icon('esri-globe') %> <%= t('geoblacklight.tools.open_arcgis') %>
3
+ <%= blacklight_icon('esri-globe') %><%= t('geoblacklight.tools.open_arcgis') %>
4
4
  <% end %>
@@ -1,6 +1,5 @@
1
1
  <% if document.data_dictionary_download.present? %>
2
2
  <%= link_to document.data_dictionary_download[:data_dictionary] do %>
3
- <%= geoblacklight_icon('book', aria_hidden: true) %>
4
- <%= t('geoblacklight.references.data_dictionary') %>
3
+ <%= geoblacklight_icon('book', aria_hidden: true) %><%= t('geoblacklight.references.data_dictionary') %>
5
4
  <% end %>
6
5
  <% 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', 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 } %>
5
+ <%= content_tag :div, '', id: 'map', class: 'col-md-6', aria: { label: t('geoblacklight.map.label') }, data: { map: results_js_map_selector(controller.controller_name), 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
6
6
  </div>
@@ -1,3 +1,3 @@
1
1
  <%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE], classes: 'svg_tooltip') %>
2
- <%= geoblacklight_icon(document[Settings.FIELDS.PROVENANCE], classes: 'svg_tooltip') %>
2
+ <%= geoblacklight_icon(document[Settings.FIELDS.PROVIDER], classes: 'svg_tooltip') %>
3
3
  <%= geoblacklight_icon(document[Settings.FIELDS.RIGHTS], classes: 'svg_tooltip') %>
@@ -3,41 +3,19 @@
3
3
  <div class='col-sm'>
4
4
  <%= content_tag :h3, t('geoblacklight.home.category_heading') %>
5
5
  <div class='row'>
6
- <div class='category-block col-sm'>
7
- <div class='category-icon'>
8
- <%= geoblacklight_icon('home') %>
9
- </div>
10
- <%= content_tag :h4, t('geoblacklight.home.institution') %>
11
- <%= render_facet_tags [Settings.FIELDS.PROVENANCE] %>
12
- </div>
13
- <div class='category-block col-sm'>
14
- <div class='category-icon'>
15
- <%= geoblacklight_icon('arrow-circle-down') %>
16
- </div>
17
- <%= content_tag :h4, t('geoblacklight.home.data_type') %>
18
- <%= render_facet_tags [Settings.FIELDS.GEOM_TYPE] %>
19
- </div>
6
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'home', label: 'geoblacklight.home.institution', facet_field: Settings.FIELDS.PROVIDER, response: @response)) %>
7
+
8
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'arrow-circle-down', label: 'geoblacklight.home.data_type', facet_field: Settings.FIELDS.RESOURCE_TYPE, response: @response)) %>
20
9
  </div>
21
10
  <div class='row'>
22
- <div class='category-block col-sm'>
23
- <div class='category-icon'>
24
- <%= geoblacklight_icon('globe') %>
25
- </div>
26
- <%= content_tag :h4, t('geoblacklight.home.placename') %>
27
- <%= render_facet_tags [Settings.FIELDS.SPATIAL_COVERAGE] %>
28
- </div>
29
- <div class='category-block col-sm'>
30
- <div class='category-icon'>
31
- <%= geoblacklight_icon('tags') %>
32
- </div>
33
- <%= content_tag :h4, t('geoblacklight.home.subject') %>
34
- <%= render_facet_tags [Settings.FIELDS.SUBJECT] %>
35
- </div>
11
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'globe', label: 'geoblacklight.home.placename', facet_field: Settings.FIELDS.SPATIAL_COVERAGE, response: @response)) %>
12
+
13
+ <%= render(Geoblacklight::HomepageFeatureFacetComponent.new(icon: 'tags', label: 'geoblacklight.home.subject', facet_field: Settings.FIELDS.SUBJECT, response: @response)) %>
36
14
  </div>
37
15
  </div>
38
16
  <div class='col-sm'>
39
17
  <%= content_tag :h3, t('geoblacklight.home.map_heading') %>
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 } %>
18
+ <%= content_tag :div, '', id: 'map', aria: { label: t('geoblacklight.map.label') }, data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-geom' => Settings.HOMEPAGE_MAP_GEOM, basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
41
19
  </div>
42
20
  </div>
43
21
  <div id="geoblacklight-version" class="text-right">
@@ -1,5 +1,5 @@
1
1
  <% # header bar for doc items in index view -%>
2
- <%= content_tag :div, class: 'documentHeader index-split row', data: { layer_id: document.id, bbox: document.bounding_box_as_wsen } do %>
2
+ <%= content_tag :div, class: 'documentHeader index-split row', data: { layer_id: document.id, geom: document.geometry.geojson } do %>
3
3
  <h3 class="index_title col">
4
4
  <% counter = document_counter_with_offset(document_counter) %>
5
5
  <span class="document-counter">
@@ -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', 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 %>
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-geom' => document.geometry.geojson, '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>
@@ -1,4 +1,4 @@
1
1
  <h2>
2
- <span itemprop="name"><%= document_heading(document) %></span>
2
+ <span itemprop="name"><%= document_presenter(document).heading %></span>
3
3
  <%= render partial: 'header_icons', locals: { document: document } %>
4
4
  </h2>
@@ -1,25 +1,27 @@
1
1
  <div class="modal-header">
2
- <button type="button" class="close" data-dismiss="modal">
2
+ <h1 class="modal-title"><%= t('geoblacklight.download.hgl_request') %></h1>
3
+ <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
3
4
  <span aria-hidden="true">&times;</span>
4
5
  </button>
5
- <%= content_tag :h4, t('geoblacklight.download.hgl_request'), class: 'text-center' %>
6
6
  </div>
7
7
  <div class="modal-body">
8
8
  <form class="form-horizontal" role="form" id="hglRequest">
9
9
  <p><%= t('geoblacklight.download.hgl_instructions')%></p>
10
10
  <div class="form-group">
11
- <label for="requestEmail" class="col-sm-2 control-label"><%= t('geoblacklight.download.hgl_email')%></label>
12
- <div class="col-sm-6">
13
- <input class="form-control" type="email" id="requestEmail" />
14
- </div>
15
- <input type="hidden" id="requestUrl"
16
- value="<%= download_hgl_path(id: @document) %>" />
17
- <div class="col-sm-2">
18
- <button type="submit" class="btn btn-primary"><%= t('geoblacklight.download.hgl_request_button')%></button>
11
+ <div class="row">
12
+ <label for="requestEmail" class="col-sm-2 control-label"><%= t('geoblacklight.download.hgl_email')%></label>
13
+ <div class="col-sm-6">
14
+ <input class="form-control" type="email" id="requestEmail" />
15
+ </div>
16
+ <input type="hidden" id="requestUrl"
17
+ value="<%= download_hgl_path(id: @document) %>" />
18
+ <div class="col-sm-2">
19
+ <button type="submit" class="btn btn-primary"><%= t('geoblacklight.download.hgl_request_button')%></button>
20
+ </div>
19
21
  </div>
20
22
  </div>
21
23
  </form>
22
24
  </div>
23
25
  <div class="modal-footer">
24
- <button type="button" class="btn btn-default" data-dismiss="modal"><%= t('geoblacklight.download.hgl_close')%></button>
26
+ <button type="button" class="btn btn-default hide-without-js" data-dismiss="modal"><%= t('geoblacklight.references.services_close')%></button>
25
27
  </div>
@@ -0,0 +1,15 @@
1
+ <% @relations.send(rel)['docs'][0..2].each do |entry| %>
2
+ <li class="list-group-item border-bottom-0">
3
+ <%= link_to solr_document_path(entry[Settings.FIELDS.ID]) do %>
4
+ <%= relations_icon(entry, value.icon) unless value.icon.nil? %>
5
+ <%= entry[Settings.FIELDS.TITLE] %>
6
+ <% end %>
7
+ </li>
8
+ <% end %>
9
+ <% unless (@relations.send(rel)['numFound'].to_i <= 3) %>
10
+ <li class="list-group-item border-bottom-0">
11
+ <%= link_to search_catalog_path({f: {"#{Settings.FIELDS.SOURCE}" => [@relations.link_id]}}) do %>
12
+ <%= t('geoblacklight.relations.browse_all', count: @relations.send(rel)['numFound']) %>
13
+ <% end %>
14
+ </li>
15
+ <% end %>
@@ -1,24 +1,12 @@
1
- <% unless @relations.empty? %>
2
- <% unless @relations.ancestors['numFound'].to_i.zero? %>
1
+ <%- Settings.RELATIONSHIPS_SHOWN.each do |rel, value| %>
2
+ <% unless @relations.send(rel)['numFound'].to_i.zero? %>
3
3
  <div class="card relations">
4
4
  <div class="card-header">
5
- <h2 class="mb-0 h6"><%= t('geoblacklight.relations.ancestor') %></h2>
5
+ <h2 class="mb-0 h6"><%= t("#{value.label}") %></h2>
6
6
  </div>
7
7
 
8
8
  <ul class="list-group list-group-flush">
9
- <%= render 'ancestors' %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
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>
19
-
20
- <ul class="list-group list-group-flush">
21
- <%= render 'descendants' %>
9
+ <%= render partial: 'relations', locals: { rel: rel, value: value } %>
22
10
  </ul>
23
11
  </div>
24
12
  <% end %>
@@ -1,4 +1,8 @@
1
1
  # frozen_string_literal: true
2
- json.ancestors @relations.ancestors
3
- json.descendants @relations.descendants
2
+
4
3
  json.current_doc @relations.search_id
4
+ json.relations do
5
+ Settings.RELATIONSHIPS_SHOWN.each do |key, _value|
6
+ json.set! key.downcase.to_s, @relations.send(key) unless @relations.send(key)['numFound'].to_i.zero?
7
+ end
8
+ end
data/babel.config.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "plugins": ["@babel/plugin-transform-runtime"],
3
+ "presets": ["@babel/preset-env"]
4
+ }
@@ -0,0 +1,6 @@
1
+ # New GeoBlacklight v3.4
2
+ # Homepage Map Geometry
3
+ # Leave null to default to entire world
4
+ # Add a stringified GeoJSON object to scope initial render (example from UMass)
5
+ HOMEPAGE_MAP_GEOM: null
6
+ # HOMEPAGE_MAP_GEOM: '{"type":"Polygon","coordinates":[[[-73.58,42.93],[-73.58,41.20],[-69.90,41.20],[-69.90,42.93]]]}'
@@ -64,9 +64,18 @@ en:
64
64
  data_dictionary: 'Documentation'
65
65
  services: 'Web services'
66
66
  services_close: 'Close'
67
+ tms: 'Tile Map Service'
67
68
  relations:
68
69
  ancestor: 'Source Datasets'
69
70
  descendant: 'Derived Datasets'
71
+ member_of: 'Belongs to collection...'
72
+ part_of: 'Is part of...'
73
+ relation: 'Related Records'
74
+ replaces: 'Item replaces...'
75
+ replaced_by: 'Item replaced by...'
76
+ source: 'Source Datasets'
77
+ version_of: 'Version of...'
78
+
70
79
  browse_all: "Browse all %{count} records..."
71
80
  metadata:
72
81
  toggle_summary: 'Toggle summary'
@@ -104,6 +113,9 @@ en:
104
113
  tiled_map_layer:
105
114
  title: ArcGIS Tiled Map Layer
106
115
  content: An ArcGIS Tiled Map Layer Service displays set of web-accessible tiles that reside on a server.
116
+ tms:
117
+ title: Tile Map Service
118
+ content: A Tile Map Service displays georeferenced map tiles as an image on a map.
107
119
  wms:
108
120
  title: Web Map Service (WMS)
109
121
  content: A Web Map Service displays a geospatial dataset as map images.