geoblacklight 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecfd3b6d4079ce54a7d88ec471fd00691952b195
4
- data.tar.gz: 65dd75018fccc14c87f90860a75c6bc90e07275b
3
+ metadata.gz: 8c08882be65fd2fa60c1df470d8bd108d6f91f48
4
+ data.tar.gz: c9a105520e93ea3289286141a1e971ff0aaf969a
5
5
  SHA512:
6
- metadata.gz: 24d41c5aef850a26fc0589b8ab295896274776c10b2689fa3ef8575b0569c7ebf3b3cc4a67269098317aafc23ada1fec220d351208cbe50a04cc230d3adc4f55
7
- data.tar.gz: c38cee48ff3c3bf8db1b894b146b64e12284106b33b3d90b857c8d3c22b0419931a63c2c69055eaa13b6123e75decb6404716db62f64dec5437168685b3f4644
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-3x fa-align-center"></i></span>';
40
- $('#attribute-table').replaceWith(spinner);
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
- $('#attribute-table').html('Could not find that feature');
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 t = $('<table id="attribute-table" class="table table-hover table-condensed table-responsive table-striped table-bordered"><thead><tr><th>Attribute</th><th>Value</th></tr></thead><tbody>');
61
+ var html = $('<tbody class="attribute-table-body"></tbody>');
62
62
  $.each(data.values, function(i, val) {
63
- t.append('<tr><td>' + val[0] + '</td><td>' + val[1] + '</tr>');
63
+ html.append('<tr><td>' + val[0] + '</td><td>' + val[1] + '</tr>');
64
64
  });
65
- $('#attribute-table').replaceWith(t);
65
+ $('.attribute-table-body').replaceWith(html);
66
66
  },
67
67
  fail: function(error) {
68
68
  console.log(error);
@@ -2,7 +2,7 @@
2
2
  height: 440px;
3
3
  }
4
4
 
5
- [data-viewer="wms"][data-available="true"] {
5
+ [data-protocol="wms"][data-available="true"] {
6
6
  cursor: crosshair;
7
7
  }
8
8
 
@@ -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
- I18n.t "geoblacklight.formats.#{format.downcase}"
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
- "#{I18n.t 'geoblacklight.download.download'} #{proper_case_format(format)}".html_safe
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
@@ -1,5 +1,5 @@
1
1
  <% if @document['dc_description_s'].present? %>
2
- <dt>Abstract</dt>
2
+ <dt>Description</dt>
3
3
  <dd itemprop="description">
4
4
  <div class='truncate-abstract'>
5
5
  <%= @document['dc_description_s'] %>
@@ -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
- <div id='table-container' class='col-md-4'><div id='attribute-table' ></div></div>
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'] %>&nbsp;</dd>
15
+ <dd itemprop="publisher"><%= document['dc_publisher_s'] %>&nbsp;
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? %>
@@ -1,3 +1,3 @@
1
1
  module Geoblacklight
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -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")
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.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves