geoblacklight 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +5 -1
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +1 -10
- data/app/helpers/geoblacklight_helper.rb +4 -4
- data/app/views/catalog/_show_downloads.html.erb +2 -2
- data/lib/geoblacklight/version.rb +1 -1
- data/spec/features/download_layer_spec.rb +3 -3
- data/spec/helpers/geoblacklight_helper_spec.rb +4 -4
- metadata +3 -5
- data/spec/test_app_templates/solr_documents +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6b5a2a687ebb538b81e612ae973587c11c30f84
|
4
|
+
data.tar.gz: 720dc64d284c889f81d99a8fedbefe83c855b9db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 957e36971bdb8e95eb07ccd6100cb7aca43df15347344088152f6f8fb3d319f02ed31db85dd13e497c757242f4b54753bf9901fbac9591a6d97adb3b9ad987d7
|
7
|
+
data.tar.gz: b45106b0fb306f0e9b950b4a057758d358a650e11a2f681b940cf91de9b98bbccd19b18949bae2d52c9a89b0b4d5a3c74e222a12cd8f53464a3e1afc0435e57e
|
@@ -46,12 +46,16 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
|
|
46
46
|
X: Math.round(e.containerPoint.x),
|
47
47
|
Y: Math.round(e.containerPoint.y)
|
48
48
|
};
|
49
|
+
|
50
|
+
// Set a ujs adapter to support both rails-ujs and jquery-ujs
|
51
|
+
var ujs = typeof Rails === 'undefined' ? $.rails : Rails;
|
52
|
+
|
49
53
|
|
50
54
|
$.ajax({
|
51
55
|
type: 'POST',
|
52
56
|
url: '/wms/handle',
|
53
57
|
beforeSend: function(xhr) {
|
54
|
-
xhr.setRequestHeader('X-CSRF-Token',
|
58
|
+
xhr.setRequestHeader('X-CSRF-Token', ujs.csrfToken());
|
55
59
|
},
|
56
60
|
data: wmsoptions,
|
57
61
|
success: function(data) {
|
@@ -9,15 +9,6 @@
|
|
9
9
|
&-link {
|
10
10
|
&-container {
|
11
11
|
padding: 4px 15px;
|
12
|
-
text-align: center;
|
13
|
-
|
14
|
-
a {
|
15
|
-
width: 100%;
|
16
|
-
font-weight: 600;
|
17
|
-
background-color: $link-color;
|
18
|
-
color: #ffffff;
|
19
|
-
border-color: darken($link-color, 6.5%);
|
20
|
-
}
|
21
12
|
}
|
22
13
|
}
|
23
14
|
}
|
@@ -34,7 +25,7 @@
|
|
34
25
|
@extend %downloads-exports;
|
35
26
|
|
36
27
|
.panel-heading {
|
37
|
-
|
28
|
+
h3 {
|
38
29
|
display: inline;
|
39
30
|
}
|
40
31
|
|
@@ -27,7 +27,7 @@ module GeoblacklightHelper
|
|
27
27
|
text,
|
28
28
|
document.direct_download[:download],
|
29
29
|
'contentUrl' => document.direct_download[:download],
|
30
|
-
class: ['btn', 'btn-
|
30
|
+
class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-original'],
|
31
31
|
data: {
|
32
32
|
download: 'trigger',
|
33
33
|
download_type: 'direct',
|
@@ -40,7 +40,7 @@ module GeoblacklightHelper
|
|
40
40
|
link_to(
|
41
41
|
text,
|
42
42
|
download_hgl_path(id: document),
|
43
|
-
class: ['btn', 'btn-
|
43
|
+
class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-original'],
|
44
44
|
data: {
|
45
45
|
ajax_modal: 'trigger',
|
46
46
|
download: 'trigger',
|
@@ -57,7 +57,7 @@ module GeoblacklightHelper
|
|
57
57
|
download_text('JPG'),
|
58
58
|
iiif_jpg_url,
|
59
59
|
'contentUrl' => iiif_jpg_url,
|
60
|
-
class: ['btn', 'btn-
|
60
|
+
class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-generated'],
|
61
61
|
data: {
|
62
62
|
download: 'trigger'
|
63
63
|
}
|
@@ -68,7 +68,7 @@ module GeoblacklightHelper
|
|
68
68
|
link_to(
|
69
69
|
t('geoblacklight.download.export_link', download_format: proper_case_format(download_type)),
|
70
70
|
'',
|
71
|
-
class: ['btn', 'btn-
|
71
|
+
class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-generated'],
|
72
72
|
data: {
|
73
73
|
download_path: download_path(document.id, type: download_type),
|
74
74
|
download: 'trigger',
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% if document.direct_download.present? || document.hgl_download.present? || document.iiif_download.present? %>
|
5
5
|
<div class="panel panel-default downloads">
|
6
6
|
<div class="panel-heading">
|
7
|
-
<
|
7
|
+
<h3 class="h5"><%= t('geoblacklight.download.download').pluralize %></h3>
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<ul class="list-group list-group-flush">
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<% if document.download_types.present? %>
|
17
17
|
<div class="panel panel-default exports">
|
18
18
|
<div class="panel-heading">
|
19
|
-
<
|
19
|
+
<h3 class="h5"><%= t('geoblacklight.download.export_formats') %></h3>
|
20
20
|
</div>
|
21
21
|
|
22
22
|
<ul class="list-group list-group-flush">
|
@@ -42,7 +42,7 @@ feature 'Download layer' do
|
|
42
42
|
end
|
43
43
|
scenario 'clicking jpg download button should redirect to external image' do
|
44
44
|
visit solr_document_path('princeton-02870w62c')
|
45
|
-
expect(page).to have_css("a.btn.btn-
|
45
|
+
expect(page).to have_css("a.btn.btn-primary[href='https://libimages.princeton.edu/loris/pudl0076/map_pownall/00000001.jp2/full/full/0/default.jpg']", text: 'Original JPG')
|
46
46
|
end
|
47
47
|
scenario 'options should be available under toggle' do
|
48
48
|
visit solr_document_path('mit-f6rqs4ucovjk2')
|
@@ -63,9 +63,9 @@ feature 'Download layer' do
|
|
63
63
|
scenario 'layer with direct download and wms/wfs should include all download types' do
|
64
64
|
sign_in
|
65
65
|
visit solr_document_path('stanford-cg357zz0321')
|
66
|
-
expect(page).to have_css '
|
66
|
+
expect(page).to have_css 'h3', text: 'Downloads'
|
67
67
|
expect(page).to have_css 'a', text: 'Original Shapefile'
|
68
|
-
expect(page).to have_css '
|
68
|
+
expect(page).to have_css 'h3', text: 'Export Formats'
|
69
69
|
expect(page).to have_css 'a', text: 'Export'
|
70
70
|
end
|
71
71
|
scenario 'clicking GeoTIFF button for Harvard layer should show email form', js: true do
|
@@ -82,7 +82,7 @@ describe GeoblacklightHelper, type: :helper do
|
|
82
82
|
allow_any_instance_of(Geoblacklight::Reference).to receive(:to_hash).and_return(download: 'http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip')
|
83
83
|
end
|
84
84
|
it 'generates a link to download the original file' do
|
85
|
-
expect(download_link_direct(text, document)).to eq '<a contentUrl="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip" class="btn btn-
|
85
|
+
expect(download_link_direct(text, document)).to eq '<a contentUrl="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip" class="btn btn-primary btn-block download download-original" data-download="trigger" data-download-type="direct" href="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip">Test Link Text</a>'
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -96,7 +96,7 @@ describe GeoblacklightHelper, type: :helper do
|
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'generates a link to the HGL route' do
|
99
|
-
expect(download_link_hgl(text, document)).to eq '<a class="btn btn-
|
99
|
+
expect(download_link_hgl(text, document)).to eq '<a class="btn btn-primary btn-block download download-original" data-ajax-modal="trigger" data-download="trigger" data-download-type="harvard-hgl" data-download-id="test-id" href="/download/hgl/test-id">Test Link Text</a>'
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -117,7 +117,7 @@ describe GeoblacklightHelper, type: :helper do
|
|
117
117
|
|
118
118
|
it 'generates a link to download the JPG file from the IIIF server' do
|
119
119
|
assign(:document, document)
|
120
|
-
expect(helper.download_link_iiif).to eq '<a contentUrl="https://example.edu/image/full/full/0/default.jpg" class="btn btn-
|
120
|
+
expect(helper.download_link_iiif).to eq '<a contentUrl="https://example.edu/image/full/full/0/default.jpg" class="btn btn-primary btn-block download download-generated" data-download="trigger" href="https://example.edu/image/full/full/0/default.jpg">Original JPG</a>'
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
@@ -131,7 +131,7 @@ describe GeoblacklightHelper, type: :helper do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
it 'generates a link to download the JPG file from the IIIF server' do
|
134
|
-
expect(download_link_generated(download_type, document)).to eq '<a class="btn btn-
|
134
|
+
expect(download_link_generated(download_type, document)).to eq '<a class="btn btn-primary btn-block download download-generated" data-download-path="/download/test-id?type=SHAPEFILE" data-download="trigger" data-download-type="SHAPEFILE" data-download-id="test-id" href="">Export</a>'
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
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: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Graves
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-08-
|
14
|
+
date: 2018-08-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -672,7 +672,6 @@ files:
|
|
672
672
|
- spec/test_app_templates/metadata/fgdc.xml
|
673
673
|
- spec/test_app_templates/metadata/iso.html
|
674
674
|
- spec/test_app_templates/metadata/iso.xml
|
675
|
-
- spec/test_app_templates/solr_documents
|
676
675
|
- spec/views/catalog/_document_split.html.erb_spec.rb
|
677
676
|
- spec/views/catalog/_index_split.html.erb_spec.rb
|
678
677
|
- spec/views/catalog/_show_downloads.html.erb_spec.rb
|
@@ -702,7 +701,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
702
701
|
version: 2.5.2
|
703
702
|
requirements: []
|
704
703
|
rubyforge_project:
|
705
|
-
rubygems_version: 2.
|
704
|
+
rubygems_version: 2.4.5
|
706
705
|
signing_key:
|
707
706
|
specification_version: 4
|
708
707
|
summary: A discovery platform for geospatial holdings
|
@@ -813,7 +812,6 @@ test_files:
|
|
813
812
|
- spec/test_app_templates/metadata/fgdc.xml
|
814
813
|
- spec/test_app_templates/metadata/iso.html
|
815
814
|
- spec/test_app_templates/metadata/iso.xml
|
816
|
-
- spec/test_app_templates/solr_documents
|
817
815
|
- spec/views/catalog/_document_split.html.erb_spec.rb
|
818
816
|
- spec/views/catalog/_index_split.html.erb_spec.rb
|
819
817
|
- spec/views/catalog/_show_downloads.html.erb_spec.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
spec/test_app_templates/../fixtures/solr_documents
|