geoblacklight 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/geoblacklight/viewers/map.js +3 -0
- data/app/helpers/geoblacklight_helper.rb +15 -1
- data/app/views/catalog/_show_sidebar.html.erb +4 -4
- data/config/locales/geoblacklight.en.yml +8 -1
- data/lib/geoblacklight/item_viewer.rb +1 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/spec/features/download_layer_spec.rb +3 -3
- data/spec/features/iiif_viewer_spec.rb +8 -0
- data/spec/features/layer_with_no_references_spec.rb +8 -0
- data/spec/helpers/geoblacklight_helpers_spec.rb +19 -0
- data/spec/lib/geoblacklight/solr_document_spec.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bffcde6f01bb25c38878c4c4643912723d2c8b4a
|
4
|
+
data.tar.gz: ba83d359a86f42f7ed8c558db32a7f2a36fb0b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5ce60b374a179e08b712b54a212ccda9c6076dcfb10440aa8055edfe90534de27de88b93f1e9677f4e67bd2b032608b0b991eecf645291b4d7b1421044219b6
|
7
|
+
data.tar.gz: c42ef4e4c98c0a8b66e55dd10eb1400079b96ee99a35f1973e9abf10ce21e64e437262dbc4c69b5569a61a31161710169cb334a9e5e824bdf36baf6068185ed3
|
@@ -22,6 +22,9 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
|
|
22
22
|
overlay: L.layerGroup(),
|
23
23
|
|
24
24
|
load: function() {
|
25
|
+
if (this.data.mapBbox) {
|
26
|
+
this.options.bbox = L.bboxToBounds(this.data.mapBbox);
|
27
|
+
}
|
25
28
|
this.map = L.map(this.element).fitBounds(this.options.bbox);
|
26
29
|
this.map.addLayer(this.basemap);
|
27
30
|
this.map.addLayer(this.overlay);
|
@@ -41,7 +41,7 @@ module GeoblacklightHelper
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def layer_type_image(type)
|
44
|
-
content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{type.downcase}"
|
44
|
+
content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{type.downcase.gsub(' ', '-')}"
|
45
45
|
end
|
46
46
|
|
47
47
|
def layer_institution_image(institution)
|
@@ -66,4 +66,18 @@ module GeoblacklightHelper
|
|
66
66
|
def render_facet_links(facet, items)
|
67
67
|
items.uniq.map { |item| link_to item, catalog_index_path(f: { "#{facet}" => [item] }) }.join(', ').html_safe
|
68
68
|
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# Looks up properly formatted names for formats
|
72
|
+
#
|
73
|
+
def proper_case_format(format)
|
74
|
+
I18n.t "geoblacklight.formats.#{format.downcase}"
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Wraps download text with proper_case_format
|
79
|
+
#
|
80
|
+
def download_text(format)
|
81
|
+
"#{I18n.t 'geoblacklight.download.download'} #{proper_case_format(format)}".html_safe
|
82
|
+
end
|
69
83
|
end
|
@@ -21,9 +21,9 @@
|
|
21
21
|
<% if document_downloadable? %>
|
22
22
|
<div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
|
23
23
|
<% unless document.direct_download.blank? %>
|
24
|
-
<%= link_to(
|
24
|
+
<%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download]) %>
|
25
25
|
<% else %>
|
26
|
-
<%= link_to(
|
26
|
+
<%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}"}, class: 'btn btn-default') %>
|
27
27
|
<% end %>
|
28
28
|
<button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
|
29
29
|
<span class='caret'></span>
|
@@ -33,14 +33,14 @@
|
|
33
33
|
<% unless document.direct_download.blank? %>
|
34
34
|
<li role="presentation" class="dropdown-header">Original</li>
|
35
35
|
<li>
|
36
|
-
<%= link_to(
|
36
|
+
<%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], 'contentUrl' => document.direct_download[:download]) %>
|
37
37
|
</li>
|
38
38
|
<% end %>
|
39
39
|
<% if document.download_types.present? %>
|
40
40
|
<li role="presentation" class="dropdown-header">Generated</li>
|
41
41
|
<% document.download_types.each do |type| %>
|
42
42
|
<%= content_tag(:li) do %>
|
43
|
-
<% link_to(
|
43
|
+
<% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: type[0])}" }) %>
|
44
44
|
<% end %>
|
45
45
|
<% end %>
|
46
46
|
<% end %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
en:
|
2
2
|
geoblacklight:
|
3
3
|
download:
|
4
|
+
download: 'Download'
|
4
5
|
success: 'Your file %{title} is ready for download'
|
5
6
|
error: 'Sorry, the requested file could not be downloaded'
|
6
7
|
home:
|
@@ -9,4 +10,10 @@ en:
|
|
9
10
|
category_heading: 'Find by...'
|
10
11
|
map_heading: 'Find by location'
|
11
12
|
tools:
|
12
|
-
login_to_view: 'Login to view and download'
|
13
|
+
login_to_view: 'Login to view and download'
|
14
|
+
formats:
|
15
|
+
arcgrid: 'ArcGRID'
|
16
|
+
geojson: 'GeoJSON'
|
17
|
+
geotiff: 'GeoTIFF'
|
18
|
+
kmz: 'KMZ'
|
19
|
+
shapefile: 'Shapefile'
|
@@ -11,14 +11,14 @@ feature 'Download layer' do
|
|
11
11
|
expect_any_instance_of(KmzDownload).to receive(:get).and_return('mit-us-ma-e25zcta5dct-2000-kmz.kmz')
|
12
12
|
visit catalog_path('mit-us-ma-e25zcta5dct-2000')
|
13
13
|
find('button.download-dropdown-toggle').click
|
14
|
-
find('a', text: 'Download
|
14
|
+
find('a', text: 'Download KMZ').click
|
15
15
|
expect(page).to have_css('a', text: 'Your file mit-us-ma-e25zcta5dct-2000-kmz.kmz is ready for download')
|
16
16
|
end
|
17
17
|
scenario 'options should be available under toggle' do
|
18
18
|
visit catalog_path('mit-us-ma-e25zcta5dct-2000')
|
19
19
|
find('button.download-dropdown-toggle').click
|
20
20
|
expect(page).to have_css('li a', text: 'Download Shapefile')
|
21
|
-
expect(page).to have_css('li a', text: 'Download
|
21
|
+
expect(page).to have_css('li a', text: 'Download KMZ')
|
22
22
|
end
|
23
23
|
scenario 'restricted layer should not have download available to non logged in user' do
|
24
24
|
visit catalog_path('stanford-jf841ys4828')
|
@@ -40,6 +40,6 @@ feature 'Download layer' do
|
|
40
40
|
expect(page).to have_css 'li.dropdown-header', text: 'Original'
|
41
41
|
expect(page).to have_css 'li.dropdown-header', text: 'Generated'
|
42
42
|
expect(page).to have_css 'li a', text: 'Download Shapefile'
|
43
|
-
expect(page).to have_css 'li a', text: 'Download
|
43
|
+
expect(page).to have_css 'li a', text: 'Download KMZ'
|
44
44
|
end
|
45
45
|
end
|
@@ -13,4 +13,23 @@ describe GeoblacklightHelper do
|
|
13
13
|
expect(html).to have_css 'a', text: 'Science', count: 1
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
describe '#layer_type_image' do
|
18
|
+
it 'lowercases and subs spaces for hyphens' do
|
19
|
+
html = Capybara.string(layer_type_image('TEst 123'))
|
20
|
+
expect(html).to have_css '.geoblacklight-test-123'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#proper_case_format' do
|
25
|
+
it 'returns a properly cased format' do
|
26
|
+
expect(proper_case_format('GEOJSON')).to eq 'GeoJSON'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#download_text' do
|
31
|
+
it 'returns download text concatenated with proper case format' do
|
32
|
+
expect(download_text('GEOJSON')).to eq 'Download GeoJSON'
|
33
|
+
end
|
34
|
+
end
|
16
35
|
end
|
@@ -122,7 +122,7 @@ describe Geoblacklight::SolrDocument do
|
|
122
122
|
end
|
123
123
|
let(:document_attributes) { {} }
|
124
124
|
it 'returns leaflet protocol' do
|
125
|
-
expect(document.viewer_protocol).to eq '
|
125
|
+
expect(document.viewer_protocol).to eq 'map'
|
126
126
|
end
|
127
127
|
end
|
128
128
|
describe 'viewer_endpoint' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Graves
|
@@ -337,8 +337,10 @@ files:
|
|
337
337
|
- spec/features/dct_references_spec.rb
|
338
338
|
- spec/features/download_layer_spec.rb
|
339
339
|
- spec/features/home_page_spec.rb
|
340
|
+
- spec/features/iiif_viewer_spec.rb
|
340
341
|
- spec/features/layer_inspection_spec.rb
|
341
342
|
- spec/features/layer_preview_spec.rb
|
343
|
+
- spec/features/layer_with_no_references_spec.rb
|
342
344
|
- spec/features/saved_searches_spec.rb
|
343
345
|
- spec/features/search_bar_spec.rb
|
344
346
|
- spec/features/split_view.html.erb_spec.rb
|
@@ -404,8 +406,10 @@ test_files:
|
|
404
406
|
- spec/features/dct_references_spec.rb
|
405
407
|
- spec/features/download_layer_spec.rb
|
406
408
|
- spec/features/home_page_spec.rb
|
409
|
+
- spec/features/iiif_viewer_spec.rb
|
407
410
|
- spec/features/layer_inspection_spec.rb
|
408
411
|
- spec/features/layer_preview_spec.rb
|
412
|
+
- spec/features/layer_with_no_references_spec.rb
|
409
413
|
- spec/features/saved_searches_spec.rb
|
410
414
|
- spec/features/search_bar_spec.rb
|
411
415
|
- spec/features/split_view.html.erb_spec.rb
|