geoblacklight 0.3.2 → 0.3.3
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/wms.js +6 -6
- data/app/assets/stylesheets/geoblacklight/modules/item.css.scss +1 -1
- data/app/helpers/geoblacklight_helper.rb +6 -2
- data/app/views/catalog/_abstract_metadata.html.erb +1 -1
- data/app/views/catalog/_show_default.html.erb +19 -1
- data/app/views/catalog/_upper_metadata.html.erb +7 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/spec/features/layer_inspection_spec.rb +2 -3
- data/spec/helpers/geoblacklight_helpers_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c08882be65fd2fa60c1df470d8bd108d6f91f48
|
4
|
+
data.tar.gz: c9a105520e93ea3289286141a1e971ff0aaf969a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3de4a27f65f96999a33ec65f852efa87533a2eec2ca9c136a1895dadfd7d790a5241fd704c46b11b93d427586efbde4ebb471e0bc95cbc7069ad50a18660dc
|
7
|
+
data.tar.gz: ac0a1aa66f06d4be608ebd74273861fb6cc1a5b1f00d0b60394bf2b383efd7c80cd916fd9b4c4a674ac95325d3908193f7aac2aeb056055206786878b2dfc7df
|
@@ -36,8 +36,8 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
|
|
36
36
|
setupInspection: function() {
|
37
37
|
var _this = this;
|
38
38
|
this.map.on('click', function(e) {
|
39
|
-
spinner = '<span id="attribute-table"><i class="fa fa-spinner fa-spin fa-
|
40
|
-
$('
|
39
|
+
spinner = '<tbody class="attribute-table-body"><tr><td colspan="2"><span id="attribute-table"><i class="fa fa-spinner fa-spin fa-align-center"></i></span></td></tr></tbody>';
|
40
|
+
$('.attribute-table-body').replaceWith(spinner);
|
41
41
|
var wmsoptions = {
|
42
42
|
URL: _this.data.url,
|
43
43
|
LAYERS: _this.data.layerId,
|
@@ -55,14 +55,14 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
|
|
55
55
|
data: wmsoptions,
|
56
56
|
success: function(data) {
|
57
57
|
if (data.hasOwnProperty('error')) {
|
58
|
-
$('
|
58
|
+
$('.attribute-table-body').html('<tbody class="attribute-table-body"><tr><td colspan="2">Could not find that feature</td></tr></tbody>');
|
59
59
|
return;
|
60
60
|
}
|
61
|
-
var
|
61
|
+
var html = $('<tbody class="attribute-table-body"></tbody>');
|
62
62
|
$.each(data.values, function(i, val) {
|
63
|
-
|
63
|
+
html.append('<tr><td>' + val[0] + '</td><td>' + val[1] + '</tr>');
|
64
64
|
});
|
65
|
-
$('
|
65
|
+
$('.attribute-table-body').replaceWith(html);
|
66
66
|
},
|
67
67
|
fail: function(error) {
|
68
68
|
console.log(error);
|
@@ -71,13 +71,17 @@ module GeoblacklightHelper
|
|
71
71
|
# Looks up properly formatted names for formats
|
72
72
|
#
|
73
73
|
def proper_case_format(format)
|
74
|
-
|
74
|
+
t "geoblacklight.formats.#{format.downcase}"
|
75
75
|
end
|
76
76
|
|
77
77
|
##
|
78
78
|
# Wraps download text with proper_case_format
|
79
79
|
#
|
80
80
|
def download_text(format)
|
81
|
-
"#{
|
81
|
+
"#{t 'geoblacklight.download.download'} #{proper_case_format(format)}".html_safe
|
82
|
+
end
|
83
|
+
|
84
|
+
def show_attribute_table?
|
85
|
+
return true if document_available? && @document.viewer_protocol == 'wms'
|
82
86
|
end
|
83
87
|
end
|
@@ -7,5 +7,23 @@
|
|
7
7
|
<%= content_tag :div, id: 'map', data: { map: 'item', protocol: document.viewer_protocol, url: document.viewer_endpoint, 'layer-id' => document[:layer_id_s], 'map-bbox' => document[:solr_bbox], 'catalog-path'=> catalog_index_path, available: document_available? } do %>
|
8
8
|
<% end %>
|
9
9
|
</div>
|
10
|
-
|
10
|
+
<% if show_attribute_table? %>
|
11
|
+
<div id='table-container' class='col-md-4'>
|
12
|
+
<div id='attribute-table'>
|
13
|
+
<table id="attribute-table" class="table table-hover table-condensed table-responsive table-striped table-bordered">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th>Attribute</th>
|
17
|
+
<th>Value</th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody class='attribute-table-body'>
|
21
|
+
<tr>
|
22
|
+
<td class='default-text' colspan='2'><em>Click on map to inspect values</em></td>
|
23
|
+
</tr>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
11
29
|
</div>
|
@@ -12,7 +12,13 @@
|
|
12
12
|
<% end %>
|
13
13
|
<% unless document['dc_publisher_s'].nil? %>
|
14
14
|
<dt>Publisher</dt>
|
15
|
-
<dd itemprop="publisher"><%= document['dc_publisher_s'] %> 
|
15
|
+
<dd itemprop="publisher"><%= document['dc_publisher_s'] %>
|
16
|
+
<% if document['dct_issued_s'].present? %>
|
17
|
+
<div itemprop="datePublished">
|
18
|
+
(<%= document['dct_issued_s'] %>)
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</dd>
|
16
22
|
<% end %>
|
17
23
|
<%= render 'abstract_metadata' %>
|
18
24
|
<% unless document['dct_isPartOf_sm'].nil? %>
|
@@ -2,10 +2,9 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
feature 'Layer inspection', js: true do
|
4
4
|
scenario 'clicking map should trigger inspection' do
|
5
|
-
table_values = { values: [['Attribute']] }
|
6
|
-
expect_any_instance_of(WmsLayer).to receive(:get_feature_info).and_return(table_values)
|
7
5
|
visit catalog_path('mit-us-ma-e25zcta5dct-2000')
|
8
|
-
find('#map').click
|
9
6
|
expect(page).to have_css('th', text: 'Attribute')
|
7
|
+
find('#map').trigger('click')
|
8
|
+
expect(page).to_not have_css('td.default-text')
|
10
9
|
end
|
11
10
|
end
|
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe GeoblacklightHelper do
|
4
4
|
include GeoblacklightHelper
|
5
5
|
include ActionView::Helpers::UrlHelper
|
6
|
+
include ActionView::Helpers::TranslationHelper
|
6
7
|
describe '#render_facet_links' do
|
7
8
|
it 'should contain unique links' do
|
8
9
|
expect(self).to receive(:catalog_index_path).exactly(3).times.and_return("http://example.com/catalog?f[dc_subject_sm][]=category")
|