geoblacklight 0.12.1 → 1.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +8 -0
  3. data/.jshintignore +2 -0
  4. data/.jshintrc +67 -0
  5. data/.rubocop.yml +29 -3
  6. data/Gemfile +20 -16
  7. data/README.md +1 -0
  8. data/Rakefile +3 -2
  9. data/app/assets/javascripts/geoblacklight/basemaps.js +0 -9
  10. data/app/assets/javascripts/geoblacklight/controls.js +1 -0
  11. data/app/assets/javascripts/geoblacklight/controls/opacity.js +8 -0
  12. data/app/assets/javascripts/geoblacklight/geoblacklight.js +3 -2
  13. data/app/assets/javascripts/geoblacklight/viewers.js +1 -1
  14. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -3
  15. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +2 -2
  16. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +1 -5
  17. data/app/assets/javascripts/geoblacklight/viewers/iiif.js +1 -1
  18. data/app/assets/javascripts/geoblacklight/viewers/map.js +1 -9
  19. data/app/assets/javascripts/geoblacklight/viewers/viewer.js +42 -1
  20. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
  21. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +4 -0
  22. data/app/helpers/geoblacklight_helper.rb +28 -14
  23. data/app/models/concerns/geoblacklight/solr_document.rb +20 -11
  24. data/{lib/geoblacklight/search_builder.rb → app/models/concerns/geoblacklight/spatial_search_behavior.rb} +6 -8
  25. data/app/presenters/geoblacklight/document_presenter.rb +14 -7
  26. data/app/views/catalog/_document_split.html.erb +1 -1
  27. data/app/views/catalog/_downloads.html.erb +46 -38
  28. data/app/views/catalog/_facet_tag_item.html.erb +1 -1
  29. data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
  30. data/app/views/catalog/_header_icons.html.erb +3 -0
  31. data/app/views/catalog/_home_text.html.erb +5 -5
  32. data/app/views/catalog/_index_split_default.html.erb +5 -7
  33. data/app/views/catalog/_search_form_no_navbar.html.erb +2 -2
  34. data/app/views/catalog/_show_default_viewer_container.html.erb +2 -2
  35. data/app/views/catalog/_show_header_default.html.erb +1 -3
  36. data/app/views/catalog/_web_services_wfs.html.erb +1 -1
  37. data/app/views/catalog/_web_services_wms.html.erb +1 -1
  38. data/config/jetty.yml +1 -1
  39. data/config/locales/geoblacklight.en.yml +1 -0
  40. data/geoblacklight.gemspec +4 -4
  41. data/lib/generators/geoblacklight/install_generator.rb +34 -3
  42. data/lib/generators/geoblacklight/templates/catalog_controller.rb +36 -31
  43. data/lib/generators/geoblacklight/templates/config/jetty.yml +1 -1
  44. data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -0
  45. data/lib/generators/geoblacklight/templates/{geoblacklight.css.scss → geoblacklight.scss} +0 -0
  46. data/lib/generators/geoblacklight/templates/settings.yml +42 -2
  47. data/lib/geoblacklight.rb +1 -2
  48. data/lib/geoblacklight/constants.rb +1 -1
  49. data/lib/geoblacklight/download.rb +8 -7
  50. data/lib/geoblacklight/download/geojson_download.rb +1 -1
  51. data/lib/geoblacklight/download/geotiff_download.rb +1 -1
  52. data/lib/geoblacklight/download/kmz_download.rb +1 -1
  53. data/lib/geoblacklight/download/shapefile_download.rb +1 -1
  54. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +4 -10
  55. data/lib/geoblacklight/metadata.rb +3 -6
  56. data/lib/geoblacklight/references.rb +2 -2
  57. data/lib/geoblacklight/routes.rb +3 -17
  58. data/lib/geoblacklight/routes/downloadable.rb +14 -0
  59. data/lib/geoblacklight/routes/exportable.rb +16 -0
  60. data/lib/geoblacklight/routes/wms.rb +13 -0
  61. data/lib/geoblacklight/version.rb +1 -1
  62. data/spec/controllers/catalog_controller_spec.rb +1 -1
  63. data/spec/controllers/download_controller_spec.rb +7 -1
  64. data/spec/features/bookmarks_spec.rb +1 -1
  65. data/spec/features/configurable_basemap_spec.rb +9 -8
  66. data/spec/features/download_layer_spec.rb +33 -15
  67. data/spec/features/esri_viewer_spec.rb +9 -8
  68. data/spec/features/exports_spec.rb +3 -3
  69. data/spec/features/home_page_spec.rb +1 -1
  70. data/spec/features/iiif_viewer_spec.rb +1 -1
  71. data/spec/features/layer_inspection_spec.rb +2 -2
  72. data/spec/features/layer_opacity_spec.rb +7 -2
  73. data/spec/features/layer_preview_spec.rb +2 -2
  74. data/spec/features/metadata_panel_spec.rb +3 -3
  75. data/spec/features/saved_searches_spec.rb +1 -1
  76. data/spec/features/search_bar_spec.rb +2 -2
  77. data/spec/features/show_page_metadata_spec.rb +1 -1
  78. data/spec/features/split_view.html.erb_spec.rb +6 -5
  79. data/spec/features/web_services_modal_spec.rb +3 -3
  80. data/spec/helpers/geoblacklight_helpers_spec.rb +71 -3
  81. data/spec/lib/geoblacklight/document_presenter_spec.rb +41 -13
  82. data/spec/lib/geoblacklight/download_spec.rb +9 -1
  83. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +12 -9
  84. data/spec/lib/geoblacklight/item_viewer_spec.rb +4 -3
  85. data/spec/lib/geoblacklight/references_spec.rb +22 -18
  86. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -1
  87. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +1 -1
  88. data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -1
  89. data/spec/models/concerns/geoblacklight/solr_document/carto_db_spec.rb +7 -1
  90. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +34 -11
  91. data/spec/{lib/geoblacklight/search_builder_spec.rb → models/concerns/geoblacklight/spatial_search_behavior_spec.rb} +10 -15
  92. data/spec/spec_helper.rb +6 -6
  93. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  94. metadata +25 -22
@@ -16,15 +16,15 @@ module Geoblacklight
16
16
  end
17
17
 
18
18
  def public?
19
- fetch(:dc_rights_s).downcase == 'public'
19
+ fetch(Settings.FIELDS.RIGHTS).casecmp('public').zero?
20
20
  end
21
21
 
22
22
  def restricted?
23
- fetch(:dc_rights_s).downcase == 'restricted'
23
+ fetch(Settings.FIELDS.RIGHTS).casecmp('restricted').zero?
24
24
  end
25
25
 
26
26
  def downloadable?
27
- (direct_download || download_types.present?) && available?
27
+ (direct_download || download_types.present? || iiif_download) && available?
28
28
  end
29
29
 
30
30
  def references
@@ -40,7 +40,11 @@ module Geoblacklight
40
40
  end
41
41
 
42
42
  def same_institution?
43
- fetch(:dct_provenance_s).downcase == Settings.INSTITUTION.downcase
43
+ fetch(Settings.FIELDS.PROVENANCE).casecmp(Settings.INSTITUTION.downcase).zero?
44
+ end
45
+
46
+ def iiif_download
47
+ return references.iiif.to_hash unless references.iiif.blank?
44
48
  end
45
49
 
46
50
  def item_viewer
@@ -52,7 +56,7 @@ module Geoblacklight
52
56
  end
53
57
 
54
58
  def bounding_box_as_wsen
55
- geom_field = fetch(Settings.GEOMETRY_FIELD.to_sym)
59
+ geom_field = fetch(Settings.FIELDS.GEOMETRY)
56
60
  exp = /^\s*ENVELOPE\(
57
61
  \s*([-\.\d]+)\s*,
58
62
  \s*([-\.\d]+)\s*,
@@ -60,12 +64,17 @@ module Geoblacklight
60
64
  \s*([-\.\d]+)\s*
61
65
  \)\s*$/x # uses 'x' option for free-spacing mode
62
66
  bbox_match = exp.match(geom_field)
63
- if bbox_match
64
- w, e, n, s = bbox_match.captures
65
- return "#{w} #{s} #{e} #{n}"
66
- else
67
- return s # as-is, not a WKT
68
- end
67
+ return s unless bbox_match # return as-is, not a WKT
68
+ w, e, n, s = bbox_match.captures
69
+ "#{w} #{s} #{e} #{n}"
70
+ end
71
+
72
+ def wxs_identifier
73
+ fetch(Settings.FIELDS.WXS_IDENTIFIER)
74
+ end
75
+
76
+ def file_format
77
+ fetch(Settings.FIELDS.FILE_FORMAT)
69
78
  end
70
79
 
71
80
  ##
@@ -1,11 +1,9 @@
1
1
  module Geoblacklight
2
- class SearchBuilder < Blacklight::Solr::SearchBuilder
3
- self.default_processor_chain += [:add_spatial_params]
2
+ module SpatialSearchBehavior
3
+ extend ActiveSupport::Concern
4
4
 
5
- def initialize(processor_chain, scope)
6
- super(processor_chain, scope)
7
- @processor_chain += [:add_spatial_params] unless @processor_chain
8
- .include?(:add_spatial_params)
5
+ included do
6
+ self.default_processor_chain += [:add_spatial_params]
9
7
  end
10
8
 
11
9
  ##
@@ -17,9 +15,9 @@ module Geoblacklight
17
15
  def add_spatial_params(solr_params)
18
16
  if blacklight_params[:bbox]
19
17
  solr_params[:bq] ||= []
20
- solr_params[:bq] = ["#{Settings.GEOMETRY_FIELD}:\"IsWithin(#{envelope_bounds})\"^10"]
18
+ solr_params[:bq] = ["#{Settings.FIELDS.GEOMETRY}:\"IsWithin(#{envelope_bounds})\"^10"]
21
19
  solr_params[:fq] ||= []
22
- solr_params[:fq] << "#{Settings.GEOMETRY_FIELD}:\"Intersects(#{envelope_bounds})\""
20
+ solr_params[:fq] << "#{Settings.FIELDS.GEOMETRY}:\"Intersects(#{envelope_bounds})\""
23
21
  end
24
22
  solr_params
25
23
  rescue Geoblacklight::Exceptions::WrongBoundingBoxFormat
@@ -1,15 +1,22 @@
1
1
  module Geoblacklight
2
2
  ##
3
3
  # Adds custom functionality for Geoblacklight document presentation
4
- class DocumentPresenter < Blacklight::DocumentPresenter
4
+ class DocumentPresenter < Blacklight::IndexPresenter
5
5
  ##
6
- # Accesses a documents configured Wxs Identifier
7
- # @param [SolrDocument]
6
+ # Presents configured index fields in search results. Passes values through
7
+ # configured helper_method. Multivalued fields separated by presenter
8
+ # field_value_separator (default: comma). Fields separated by period.
8
9
  # @return [String]
9
- def wxs_identifier
10
- fields = Array(@configuration.wxs_identifier_field)
11
- f = fields.find { |field| @document.has? field }
12
- render_field_value(@document[f])
10
+ def index_fields_display
11
+ fields_values = []
12
+ @configuration.index_fields.each do |field_name, _|
13
+ val = field_value(field_name)
14
+ unless val.blank?
15
+ val += '.' unless val.end_with?('.')
16
+ fields_values << val
17
+ end
18
+ end
19
+ fields_values.join(' ')
13
20
  end
14
21
  end
15
22
  end
@@ -1,4 +1,4 @@
1
1
  <div id="documents" class="docView col-md-6">
2
2
  <%= render documents, :as => :document %>
3
3
  </div>
4
- <%= content_tag :div, '', id: 'map', data: { map: 'index', 'catalog-path'=> catalog_index_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
4
+ <%= content_tag :div, '', id: 'map', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
@@ -1,45 +1,53 @@
1
1
  <% document ||= @document %>
2
2
  <% if document_downloadable? %>
3
- <div class='panel-body'>
4
- <div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
5
- <% if document.direct_download.present? %>
6
- <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
7
- <% elsif document.hgl_download.present? %>
8
- <%= link_to(download_text(document.download_types.first[0]),
9
- download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] },
10
- class: 'btn btn-default') %>
3
+ <div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
4
+ <% if document.direct_download.present? %>
5
+ <%= link_to(download_text(document.file_format), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document.id }) %>
6
+ <% elsif document.hgl_download.present? %>
7
+ <%= link_to(download_text(document.download_types.first[0]),
8
+ download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document.id },
9
+ class: 'btn btn-default') %>
10
+ <% elsif document.iiif_download.present? %>
11
+ <%= link_to "Download JPG", iiif_jpg_url, class: 'btn btn-default', download: 'trigger' %>
12
+ <% else %>
13
+ <%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document.id, type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document.id }, class: 'btn btn-default') %>
14
+ <% end %>
15
+ <button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
16
+ <span class='caret'></span>
17
+ <span class='sr-only'>Toggle Download Dropdown</span>
18
+ </button>
19
+ <ul class='dropdown-menu' role='menu'>
20
+ <% if document.hgl_download.present? %>
21
+ <li role="presentation" class="dropdown-header">Original</li>
22
+ <li>
23
+ <%= link_to(download_text(document.download_types.first[0]),
24
+ download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document.id }) %>
25
+ </li>
11
26
  <% else %>
12
- <%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document[:layer_slug_s] }, class: 'btn btn-default') %>
27
+ <% if document.direct_download.present? %>
28
+ <li role="presentation" class="dropdown-header">Original</li>
29
+ <li>
30
+ <%= link_to(download_text(@document.file_format), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document.id }) %>
31
+ </li>
13
32
  <% end %>
14
- <button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
15
- <span class='caret'></span>
16
- <span class='sr-only'>Toggle Download Dropdown</span>
17
- </button>
18
- <ul class='dropdown-menu' role='menu'>
19
- <% if document.hgl_download.present? %>
20
- <li role="presentation" class="dropdown-header">Original</li>
21
- <li>
22
- <%= link_to(download_text(document.download_types.first[0]),
23
- download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }) %>
24
- </li>
25
- <% else %>
26
- <% if document.direct_download.present? %>
27
- <li role="presentation" class="dropdown-header">Original</li>
28
- <li>
29
- <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
30
- </li>
31
- <% end %>
32
- <% if document.download_types.present? %>
33
- <li role="presentation" class="dropdown-header">Generated</li>
34
- <% document.download_types.each do |type| %>
35
- <%= content_tag(:li) do %>
36
- <% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: type[0])}", download: 'trigger', download_type: type[0], download_id: document[:layer_slug_s] }) %>
37
- <% end %>
38
- <% end %>
39
- <% end %>
40
- <% end %>
41
- </ul>
42
- </div>
33
+ <% if document.download_types.present? || document.iiif_download.present? %>
34
+ <li role="presentation" class="dropdown-header">Generated</li>
35
+ <% end %>
36
+ <% if document.iiif_download.present? %>
37
+ <li>
38
+ <%= link_to "Download JPG", iiif_jpg_url, download: 'trigger' %>
39
+ </li>
40
+ <% end %>
41
+
42
+ <% if document.download_types.present? %>
43
+ <% document.download_types.each do |type| %>
44
+ <%= content_tag(:li) do %>
45
+ <% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document.id, type: type[0])}", download: 'trigger', download_type: type[0], download_id: document.id }) %>
46
+ <% end %>
47
+ <% end %>
48
+ <% end %>
49
+ <% end %>
50
+ </ul>
43
51
  </div>
44
52
  <% elsif document.restricted? && document.same_institution? %>
45
53
  <div class='panel-body'>
@@ -1,3 +1,3 @@
1
1
  <% display_facet.items.each do |item| %>
2
- <%= link_to item.value, catalog_index_path({f: {"#{facet_field.field}" => [item.value]}}), class: 'home-facet-link' %><%= "," %>
2
+ <%= link_to item.value, search_catalog_path({f: {"#{facet_field.field}" => [item.value]}}), class: 'home-facet-link' %><%= "," %>
3
3
  <% end %>
@@ -1,2 +1,2 @@
1
1
  <%= yield %>
2
- <%= link_to t('blacklight.search.facets.more'), catalog_facet_path(display_facet.name), class: 'more_facets_link' %>
2
+ <%= link_to t('blacklight.search.facets.more'), facet_catalog_path(display_facet.name), class: 'more_facets_link' %>
@@ -0,0 +1,3 @@
1
+ <%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE]) %>
2
+ <%= geoblacklight_icon(document[Settings.FIELDS.PROVENANCE]) %>
3
+ <%= geoblacklight_icon(document[Settings.FIELDS.RIGHTS]) %>
@@ -17,33 +17,33 @@
17
17
  <span class='glyphicon glyphicon-home'></span>
18
18
  </div>
19
19
  <h4>Institution</h4>
20
- <%= render_facet_tags [:dct_provenance_s] %>
20
+ <%= render_facet_tags [Settings.FIELDS.PROVENANCE] %>
21
21
  </div>
22
22
  <div class='category-block'>
23
23
  <div class='category-icon'>
24
24
  <span class='glyphicon glyphicon-download'></span>
25
25
  </div>
26
26
  <h4>Data type</h4>
27
- <%= render_facet_tags [:layer_geom_type_s] %>
27
+ <%= render_facet_tags [Settings.FIELDS.GEOM_TYPE] %>
28
28
  </div>
29
29
  <div class='category-block'>
30
30
  <div class='category-icon'>
31
31
  <span class='glyphicon glyphicon-globe'></span>
32
32
  </div>
33
33
  <h4>Placename</h4>
34
- <%= render_facet_tags [:dct_spatial_sm] %>
34
+ <%= render_facet_tags [Settings.FIELDS.SPATIAL_COVERAGE] %>
35
35
  </div>
36
36
  <div class='category-block'>
37
37
  <div class='category-icon'>
38
38
  <span class='glyphicon glyphicon-tags'></span>
39
39
  </div>
40
40
  <h4>Subject</h4>
41
- <%= render_facet_tags [:dc_subject_sm] %>
41
+ <%= render_facet_tags [Settings.FIELDS.SUBJECT] %>
42
42
  </div>
43
43
  </div>
44
44
  <div class='col-md-6 text-center'>
45
45
  <%= content_tag :h3, t('geoblacklight.home.map_heading') %>
46
- <%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> catalog_index_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
46
+ <%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
47
47
  </div>
48
48
  </div>
49
49
  </div>
@@ -1,9 +1,7 @@
1
1
  <% # header bar for doc items in index view -%>
2
- <%= content_tag :div, class: 'documentHeader row', data: { layer_id: document[:uuid], bbox: document.bounding_box_as_wsen } do %>
2
+ <%= content_tag :div, class: 'documentHeader row', data: { layer_id: document.id, bbox: document.bounding_box_as_wsen } do %>
3
3
  <div class='status-icons'>
4
- <%= geoblacklight_icon(document['layer_geom_type_s']) %>
5
- <%= geoblacklight_icon(document['dct_provenance_s']) %>
6
- <%= geoblacklight_icon(document['dc_rights_s']) %>
4
+ <%= render partial: 'header_icons', locals: { document: document } %>
7
5
  </div>
8
6
  <h3 class="index_title col-sm-9s cosl-lg-10 text-span">
9
7
  <span class='caret-toggle'></span>
@@ -11,13 +9,13 @@
11
9
  <span class="document-counter">
12
10
  <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
13
11
  </span>
14
- <%= link_to_document document, document_show_link_field(document), counter: counter, title: document['dc_title_s'] %>
12
+ <%= link_to_document document, document_show_link_field(document), counter: counter, title: document[blacklight_config.index.title_field] %>
15
13
  </h3>
16
14
 
17
15
  <div class='col-md-12 more-info-area'>
18
- <div class='collapse' data-collapse-target="<%= document['uuid'] %>">
16
+ <div class='collapse' data-collapse-target="<%= document.id %>">
19
17
  <small>
20
- <%= document['solr_year_i'] %>. <i><%= document['dc_creator_sm'].nil?? '' : document['dc_creator_sm'].join(', ') %></i>. <%= snippit(document['dc_description_s']) %>. <%= document['dc_publisher_s'] %>.
18
+ <%= geoblacklight_present(:index_fields_display, document) %>
21
19
  </small>
22
20
  </div>
23
21
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= form_tag search_action_url, :method => :get, :class => 'search-query-form clearfix' do %>
2
- <%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %>
2
+ <%= render_hash_as_hidden_fields(search_state.params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %>
3
3
 
4
4
  <% unless search_fields.empty? %>
5
5
  <label for="search_field" class="sr-only"><%= t('blacklight.search.form.search_field.label') %></label>
@@ -8,7 +8,7 @@
8
8
  <% end %>
9
9
  <div class="input-group search-input-group">
10
10
  <label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
11
- <%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search.placeholder'), :class => "search_q q form-control", :id => "q", :autofocus => should_autofocus_on_search_box? %>
11
+ <%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search.placeholder'), :class => "search_q q form-control", :id => "q", :autofocus => should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>
12
12
 
13
13
  <span class="input-group-btn">
14
14
  <button type="submit" class="btn btn-primary search-btn" id="search">
@@ -1,5 +1,5 @@
1
1
  <% document ||= @document %>
2
2
  <div id='viewer-container' class="col-md-8">
3
- <%= content_tag :div, id: 'map', data: { map: 'item', protocol: document.viewer_protocol.camelize, url: document.viewer_endpoint, 'layer-id' => wxs_identifier(document), 'map-bbox' => document.bounding_box_as_wsen, 'catalog-path'=> catalog_index_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap } do %>
3
+ <%= 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 %>
4
4
  <% end %>
5
- </div>
5
+ </div>
@@ -1,8 +1,6 @@
1
1
  <h2>
2
2
  <span itemprop="name"><%= document_heading(document) %></span>
3
3
  <small>
4
- <%= geoblacklight_icon(document['layer_geom_type_s']) %>
5
- <%= geoblacklight_icon(document['dct_provenance_s']) %>
6
- <%= geoblacklight_icon(document['dc_rights_s']) %>
4
+ <%= render partial: 'header_icons', locals: { document: document } %>
7
5
  </small>
8
6
  </h2>
@@ -4,5 +4,5 @@
4
4
 
5
5
  <div class='form-group form-inline'>
6
6
  <label class='control-label'>WFS <code>typeNames</code></label>
7
- <input type='text' value='<%= wxs_identifier(document) %>' readonly='readonly' class='form-control'>
7
+ <input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
8
8
  </div>
@@ -4,5 +4,5 @@
4
4
 
5
5
  <div class='form-group form-inline'>
6
6
  <label class='control-label'>WMS <code>layers</code></label>
7
- <input type='text' value='<%= wxs_identifier(document) %>' readonly='readonly' class='form-control'>
7
+ <input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
8
8
  </div>
data/config/jetty.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  default:
2
2
  jetty_port: 8983
3
3
  test:
4
- jetty_port: <%= ENV['TEST_JETTY_PORT'] || 8888 %>
4
+ jetty_port: <%= ENV['TEST_JETTY_PORT'] || 8983 %>
5
5
  jetty_home: <%= ENV['TEST_JETTY_PATH'] || File.expand_path(File.join('..', 'jetty'), __FILE__) %>
6
6
  startup_wait: 15
@@ -22,6 +22,7 @@ en:
22
22
  references:
23
23
  wms: 'Web Mapping Service (WMS)'
24
24
  wfs: 'Web Feature Service (WFS)'
25
+ iiif: 'International Image Interoperability Framework (IIIF)'
25
26
  iso19139: 'ISO 19139'
26
27
  mods: 'MODS'
27
28
  fgdc: 'FGDC'
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'blacklight', '~> 5.12', '< 6'
21
+ spec.add_dependency 'blacklight', '~> 6.3'
22
22
  spec.add_dependency 'leaflet-rails', '~> 0.7.3'
23
23
  spec.add_dependency 'font-awesome-rails', '~> 4.1.0.0'
24
24
  spec.add_dependency 'rails_config', '~> 0.4.2'
@@ -27,10 +27,10 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'geoblacklight-icons', '>= 0.2'
28
28
 
29
29
  spec.add_development_dependency 'bundler', '~> 1.5'
30
- spec.add_development_dependency 'rake', '~> 10.3.2'
31
- spec.add_development_dependency 'rspec-rails', '~> 3.0.1'
30
+ spec.add_development_dependency 'rake', '~> 11.0.1'
31
+ spec.add_development_dependency 'rspec-rails', '~> 3.4.2'
32
32
  spec.add_development_dependency 'jettywrapper', '>= 2.0'
33
- spec.add_development_dependency 'engine_cart', '~> 0.8'
33
+ spec.add_development_dependency 'engine_cart', '~> 0.10'
34
34
  spec.add_development_dependency 'capybara', '~> 2.3.0'
35
35
  spec.add_development_dependency 'poltergeist', '~> 1.5'
36
36
  spec.add_development_dependency 'factory_girl_rails'
@@ -11,6 +11,31 @@ module Geoblacklight
11
11
 
12
12
  desc 'Install Geoblacklight'
13
13
 
14
+ def mount_geoblacklight_engine
15
+ route "mount Geoblacklight::Engine => 'geoblacklight'"
16
+ end
17
+
18
+ def inject_geoblacklight_routes
19
+ route <<-EOF.strip_heredoc
20
+ concern :gbl_exportable, Geoblacklight::Routes::Exportable.new
21
+ resources :solr_documents, only: [:show], controller: 'catalog' do
22
+ concerns :gbl_exportable
23
+ end
24
+
25
+ concern :gbl_wms, Geoblacklight::Routes::Wms.new
26
+ namespace :wms do
27
+ concerns :gbl_wms
28
+ end
29
+
30
+ concern :gbl_downloadable, Geoblacklight::Routes::Downloadable.new
31
+ namespace :download do
32
+ concerns :gbl_downloadable
33
+ end
34
+
35
+ resources :download, only: [:show]
36
+ EOF
37
+ end
38
+
14
39
  def install_jettywrapper
15
40
  return unless options[:jettywrapper]
16
41
  copy_file 'config/jetty.yml'
@@ -21,7 +46,7 @@ module Geoblacklight
21
46
  end
22
47
 
23
48
  def assets
24
- copy_file 'geoblacklight.css.scss', 'app/assets/stylesheets/geoblacklight.css.scss'
49
+ copy_file 'geoblacklight.scss', 'app/assets/stylesheets/geoblacklight.scss'
25
50
  copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
26
51
 
27
52
  append_to_file 'config/initializers/assets.rb',
@@ -49,19 +74,25 @@ module Geoblacklight
49
74
  end
50
75
  end
51
76
 
77
+ def add_spatial_search_behavior
78
+ inject_into_file 'app/models/search_builder.rb', after: 'include Blacklight::Solr::SearchBuilderBehavior' do
79
+ "\n include Geoblacklight::SpatialSearchBehavior"
80
+ end
81
+ end
82
+
52
83
  def create_downloads_directory
53
84
  FileUtils.mkdir_p('tmp/cache/downloads') unless File.directory?('tmp/cache/downloads')
54
85
  end
55
86
 
56
87
  # Necessary for bootstrap-sass 3.2
57
88
  def inject_sprockets
58
- blacklight_css = Dir['app/assets/stylesheets/blacklight.css.scss'].first
89
+ blacklight_css = Dir['app/assets/stylesheets/blacklight.scss'].first
59
90
  if blacklight_css
60
91
  insert_into_file blacklight_css, before: "@import 'bootstrap';" do
61
92
  "@import 'bootstrap-sprockets';\n"
62
93
  end
63
94
  else
64
- say_status 'warning', 'Can not find blacklight.css.scss, did not insert our require', :red
95
+ say_status 'warning', 'Can not find blacklight.scss, did not insert our require', :red
65
96
  end
66
97
  end
67
98