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.
- checksums.yaml +4 -4
- data/.hound.yml +8 -0
- data/.jshintignore +2 -0
- data/.jshintrc +67 -0
- data/.rubocop.yml +29 -3
- data/Gemfile +20 -16
- data/README.md +1 -0
- data/Rakefile +3 -2
- data/app/assets/javascripts/geoblacklight/basemaps.js +0 -9
- data/app/assets/javascripts/geoblacklight/controls.js +1 -0
- data/app/assets/javascripts/geoblacklight/controls/opacity.js +8 -0
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +3 -2
- data/app/assets/javascripts/geoblacklight/viewers.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -3
- data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +1 -5
- data/app/assets/javascripts/geoblacklight/viewers/iiif.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/map.js +1 -9
- data/app/assets/javascripts/geoblacklight/viewers/viewer.js +42 -1
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +4 -0
- data/app/helpers/geoblacklight_helper.rb +28 -14
- data/app/models/concerns/geoblacklight/solr_document.rb +20 -11
- data/{lib/geoblacklight/search_builder.rb → app/models/concerns/geoblacklight/spatial_search_behavior.rb} +6 -8
- data/app/presenters/geoblacklight/document_presenter.rb +14 -7
- data/app/views/catalog/_document_split.html.erb +1 -1
- data/app/views/catalog/_downloads.html.erb +46 -38
- data/app/views/catalog/_facet_tag_item.html.erb +1 -1
- data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
- data/app/views/catalog/_header_icons.html.erb +3 -0
- data/app/views/catalog/_home_text.html.erb +5 -5
- data/app/views/catalog/_index_split_default.html.erb +5 -7
- data/app/views/catalog/_search_form_no_navbar.html.erb +2 -2
- data/app/views/catalog/_show_default_viewer_container.html.erb +2 -2
- data/app/views/catalog/_show_header_default.html.erb +1 -3
- data/app/views/catalog/_web_services_wfs.html.erb +1 -1
- data/app/views/catalog/_web_services_wms.html.erb +1 -1
- data/config/jetty.yml +1 -1
- data/config/locales/geoblacklight.en.yml +1 -0
- data/geoblacklight.gemspec +4 -4
- data/lib/generators/geoblacklight/install_generator.rb +34 -3
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +36 -31
- data/lib/generators/geoblacklight/templates/config/jetty.yml +1 -1
- data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -0
- data/lib/generators/geoblacklight/templates/{geoblacklight.css.scss → geoblacklight.scss} +0 -0
- data/lib/generators/geoblacklight/templates/settings.yml +42 -2
- data/lib/geoblacklight.rb +1 -2
- data/lib/geoblacklight/constants.rb +1 -1
- data/lib/geoblacklight/download.rb +8 -7
- data/lib/geoblacklight/download/geojson_download.rb +1 -1
- data/lib/geoblacklight/download/geotiff_download.rb +1 -1
- data/lib/geoblacklight/download/kmz_download.rb +1 -1
- data/lib/geoblacklight/download/shapefile_download.rb +1 -1
- data/lib/geoblacklight/geoblacklight_helper_behavior.rb +4 -10
- data/lib/geoblacklight/metadata.rb +3 -6
- data/lib/geoblacklight/references.rb +2 -2
- data/lib/geoblacklight/routes.rb +3 -17
- data/lib/geoblacklight/routes/downloadable.rb +14 -0
- data/lib/geoblacklight/routes/exportable.rb +16 -0
- data/lib/geoblacklight/routes/wms.rb +13 -0
- data/lib/geoblacklight/version.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/download_controller_spec.rb +7 -1
- data/spec/features/bookmarks_spec.rb +1 -1
- data/spec/features/configurable_basemap_spec.rb +9 -8
- data/spec/features/download_layer_spec.rb +33 -15
- data/spec/features/esri_viewer_spec.rb +9 -8
- data/spec/features/exports_spec.rb +3 -3
- data/spec/features/home_page_spec.rb +1 -1
- data/spec/features/iiif_viewer_spec.rb +1 -1
- data/spec/features/layer_inspection_spec.rb +2 -2
- data/spec/features/layer_opacity_spec.rb +7 -2
- data/spec/features/layer_preview_spec.rb +2 -2
- data/spec/features/metadata_panel_spec.rb +3 -3
- data/spec/features/saved_searches_spec.rb +1 -1
- data/spec/features/search_bar_spec.rb +2 -2
- data/spec/features/show_page_metadata_spec.rb +1 -1
- data/spec/features/split_view.html.erb_spec.rb +6 -5
- data/spec/features/web_services_modal_spec.rb +3 -3
- data/spec/helpers/geoblacklight_helpers_spec.rb +71 -3
- data/spec/lib/geoblacklight/document_presenter_spec.rb +41 -13
- data/spec/lib/geoblacklight/download_spec.rb +9 -1
- data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +12 -9
- data/spec/lib/geoblacklight/item_viewer_spec.rb +4 -3
- data/spec/lib/geoblacklight/references_spec.rb +22 -18
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -1
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +1 -1
- data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -1
- data/spec/models/concerns/geoblacklight/solr_document/carto_db_spec.rb +7 -1
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +34 -11
- data/spec/{lib/geoblacklight/search_builder_spec.rb → models/concerns/geoblacklight/spatial_search_behavior_spec.rb} +10 -15
- data/spec/spec_helper.rb +6 -6
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- metadata +25 -22
@@ -16,15 +16,15 @@ module Geoblacklight
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def public?
|
19
|
-
fetch(
|
19
|
+
fetch(Settings.FIELDS.RIGHTS).casecmp('public').zero?
|
20
20
|
end
|
21
21
|
|
22
22
|
def restricted?
|
23
|
-
fetch(
|
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(
|
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.
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
3
|
-
|
2
|
+
module SpatialSearchBehavior
|
3
|
+
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
|
6
|
-
|
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.
|
18
|
+
solr_params[:bq] = ["#{Settings.FIELDS.GEOMETRY}:\"IsWithin(#{envelope_bounds})\"^10"]
|
21
19
|
solr_params[:fq] ||= []
|
22
|
-
solr_params[:fq] << "#{Settings.
|
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::
|
4
|
+
class DocumentPresenter < Blacklight::IndexPresenter
|
5
5
|
##
|
6
|
-
#
|
7
|
-
#
|
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
|
10
|
-
|
11
|
-
|
12
|
-
|
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'=>
|
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='
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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,
|
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'),
|
2
|
+
<%= link_to t('blacklight.search.facets.more'), facet_catalog_path(display_facet.name), class: 'more_facets_link' %>
|
@@ -17,33 +17,33 @@
|
|
17
17
|
<span class='glyphicon glyphicon-home'></span>
|
18
18
|
</div>
|
19
19
|
<h4>Institution</h4>
|
20
|
-
<%= render_facet_tags [
|
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 [
|
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 [
|
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 [
|
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'=>
|
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
|
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
|
-
<%=
|
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[
|
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
|
16
|
+
<div class='collapse' data-collapse-target="<%= document.id %>">
|
19
17
|
<small>
|
20
|
-
<%=
|
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
|
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
|
-
<%=
|
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
|
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
|
7
|
+
<input type='text' value='<%= document.wxs_identifier %>' readonly='readonly' class='form-control'>
|
8
8
|
</div>
|
data/config/jetty.yml
CHANGED
data/geoblacklight.gemspec
CHANGED
@@ -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', '~>
|
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', '~>
|
31
|
-
spec.add_development_dependency 'rspec-rails', '~> 3.
|
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.
|
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.
|
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.
|
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.
|
95
|
+
say_status 'warning', 'Can not find blacklight.scss, did not insert our require', :red
|
65
96
|
end
|
66
97
|
end
|
67
98
|
|