geoblacklight 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -13
  2. data/.coveralls.yml +1 -0
  3. data/.gitmodules +1 -1
  4. data/.travis.yml +9 -0
  5. data/Gemfile +18 -0
  6. data/README.md +36 -38
  7. data/Rakefile +9 -9
  8. data/app/assets/fonts/geoblacklight.eot +0 -0
  9. data/app/assets/fonts/geoblacklight.svg +117 -0
  10. data/app/assets/fonts/geoblacklight.ttf +0 -0
  11. data/app/assets/fonts/geoblacklight.woff +0 -0
  12. data/app/assets/images/blacklight/logo.png +0 -0
  13. data/app/assets/javascripts/geoblacklight/application.js +1 -0
  14. data/app/assets/javascripts/geoblacklight/geoblacklight.js +86 -2
  15. data/app/assets/javascripts/geoblacklight/modules/collapse.js +6 -0
  16. data/app/assets/javascripts/geoblacklight/modules/download.js +45 -0
  17. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +77 -0
  18. data/app/assets/javascripts/geoblacklight/modules/home.js +10 -0
  19. data/app/assets/javascripts/geoblacklight/modules/item.js +72 -0
  20. data/app/assets/javascripts/geoblacklight/modules/map-view.js +7 -7
  21. data/app/assets/javascripts/geoblacklight/modules/results.js +50 -0
  22. data/app/assets/stylesheets/geoblacklight/_geoblacklight.css.scss +20 -0
  23. data/app/assets/stylesheets/geoblacklight/_styles.css.scss +44 -0
  24. data/app/assets/stylesheets/geoblacklight/application.css.scss +3 -0
  25. data/app/assets/stylesheets/geoblacklight/modules/home.css.scss +3 -0
  26. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.css.scss +10 -0
  27. data/app/assets/stylesheets/geoblacklight/modules/icons.css.scss +77 -0
  28. data/app/assets/stylesheets/geoblacklight/modules/item.css.scss +4 -0
  29. data/app/assets/stylesheets/geoblacklight/modules/results.css.scss +29 -0
  30. data/app/controllers/download_controller.rb +22 -94
  31. data/app/controllers/wms_controller.rb +2 -74
  32. data/app/helpers/geoblacklight_helper.rb +6 -36
  33. data/app/views/catalog/_document_split.html.erb +4 -0
  34. data/app/views/catalog/_home_text.html.erb +2 -39
  35. data/app/views/catalog/_index_split_default.html.erb +24 -0
  36. data/app/views/catalog/_show_default.html.erb +4 -57
  37. data/app/views/catalog/_show_header_default.html.erb +8 -0
  38. data/app/views/catalog/_show_sidebar.html.erb +17 -57
  39. data/app/views/catalog/_upper_metadata.html.erb +38 -0
  40. data/config/initializers/rails_config.rb +3 -0
  41. data/config/jetty.yml +6 -0
  42. data/config/locales/geoblacklight.en.yml +5 -0
  43. data/geoblacklight.gemspec +5 -5
  44. data/lib/generators/geoblacklight/install_generator.rb +45 -15
  45. data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +2 -78
  46. data/lib/generators/geoblacklight/templates/settings.yml +9 -0
  47. data/lib/geoblacklight.rb +13 -0
  48. data/lib/geoblacklight/controller_override.rb +18 -0
  49. data/lib/geoblacklight/download.rb +63 -0
  50. data/lib/geoblacklight/download/kmz_download.rb +14 -0
  51. data/lib/geoblacklight/download/shapefile_download.rb +14 -0
  52. data/lib/geoblacklight/engine.rb +11 -1
  53. data/lib/geoblacklight/solr_document.rb +30 -0
  54. data/lib/geoblacklight/version.rb +1 -1
  55. data/lib/geoblacklight/view_helper_override.rb +17 -0
  56. data/lib/geoblacklight/wms_layer.rb +38 -0
  57. data/lib/geoblacklight/wms_layer/feature_info_response.rb +30 -0
  58. data/lib/tasks/geoblacklight.rake +15 -0
  59. data/spec/features/download_layer_spec.rb +18 -0
  60. data/spec/features/home_page_spec.rb +49 -0
  61. data/spec/features/layer_inspection_spec.rb +9 -0
  62. data/spec/features/layer_preview_spec.rb +16 -0
  63. data/spec/features/split_view.html.erb_spec.rb +35 -0
  64. data/spec/fixtures/test-berkeley-fields.json +44 -0
  65. data/spec/lib/geoblacklight/controller_override_spec.rb +28 -0
  66. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +15 -0
  67. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +14 -0
  68. data/spec/lib/geoblacklight/download_spec.rb +76 -0
  69. data/spec/lib/geoblacklight/solr_document.rb +52 -0
  70. data/spec/lib/geoblacklight/view_helper_override_spec.rb +23 -0
  71. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +43 -0
  72. data/spec/lib/geoblacklight/wms_layer_spec.rb +33 -0
  73. data/spec/spec_helper.rb +3 -6
  74. data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -2
  75. data/spec/views/catalog/_document_split.html.erb_spec.rb +5 -0
  76. data/spec/views/catalog/_index_split.html.erb_spec.rb +5 -0
  77. data/template.rb +10 -0
  78. data/vendor/assets/javascripts/native.history.js +1 -0
  79. metadata +129 -82
  80. data/app/assets/images/geoblacklight/src_berkeley.png +0 -0
  81. data/app/assets/images/geoblacklight/src_cambridge.png +0 -0
  82. data/app/assets/images/geoblacklight/src_harvard.png +0 -0
  83. data/app/assets/images/geoblacklight/src_maryland.png +0 -0
  84. data/app/assets/images/geoblacklight/src_massgis.png +0 -0
  85. data/app/assets/images/geoblacklight/src_mit.png +0 -0
  86. data/app/assets/images/geoblacklight/src_princeton.png +0 -0
  87. data/app/assets/images/geoblacklight/src_stanford.png +0 -0
  88. data/app/assets/images/geoblacklight/src_tufts.png +0 -0
  89. data/app/assets/images/geoblacklight/src_un.png +0 -0
  90. data/app/assets/images/geoblacklight/type_arc.png +0 -0
  91. data/app/assets/images/geoblacklight/type_dot.png +0 -0
  92. data/app/assets/images/geoblacklight/type_library.png +0 -0
  93. data/app/assets/images/geoblacklight/type_map.png +0 -0
  94. data/app/assets/images/geoblacklight/type_polygon.png +0 -0
  95. data/app/assets/images/geoblacklight/type_raster.png +0 -0
  96. data/app/assets/javascripts/geoblacklight/modules/map-home.js +0 -25
  97. data/app/assets/javascripts/geoblacklight/modules/map-results.js +0 -72
  98. data/app/views/catalog/_document_list.html.erb +0 -12
  99. data/app/views/catalog/_index_header_default.html.erb +0 -59
  100. data/spec/fixtures/geoblacklight_schema/transformed.json +0 -53
@@ -0,0 +1,4 @@
1
+ [data-map="item"][data-available="true"] {
2
+ cursor: crosshair;
3
+ height: 440px;
4
+ }
@@ -0,0 +1,29 @@
1
+ [data-map="index"] {
2
+ height: 480px;
3
+ }
4
+
5
+ .more-info-area {
6
+ max-height: 100px;
7
+ }
8
+
9
+ .text-span{
10
+ width:80%;
11
+ float:left;
12
+ }
13
+
14
+ .hide-overflow {
15
+ white-space: nowrap;
16
+ overflow: hidden;
17
+ text-overflow: ellipsis;
18
+ display:block
19
+ }
20
+
21
+ .status-icons {
22
+ float: right;
23
+ margin-right: 10px;
24
+ }
25
+
26
+ .index_title {
27
+ @extend .text-span;
28
+ @extend .hide-overflow;
29
+ }
@@ -1,107 +1,35 @@
1
- require 'nokogiri'
2
- require 'httparty'
3
- require 'net/http'
4
-
5
- class Layer
6
- include HTTParty
7
- format :json
1
+ class DownloadController < ApplicationController
2
+ include Blacklight::SolrHelper
8
3
 
9
- def self.getInfo(params)
10
- url = params['URL']
11
- params['BBOX'] = formatLatLng(params['BBOX'])
12
- puts params
13
- get(url, :query => params.except('URL'))
4
+ def show
5
+ @response, @document = get_solr_response_for_doc_id
6
+ response = check_type
7
+ validate response
8
+ respond_to do |format|
9
+ format.json { render json: flash, response: response }
10
+ format.html { render json: flash, response: response }
11
+ end
14
12
  end
15
- end
16
13
 
17
- class DownloadController < ApplicationController
18
14
  def file
19
-
20
- send_file "tmp/data/#{params['q']}", :type=>"application/zip", :x_sendfile=>true
21
-
15
+ send_file "tmp/downloads/#{params[:id]}.#{params[:format]}", type: 'application/zip', x_sendfile: true
22
16
  end
23
17
 
24
- def shapefile
25
-
26
- puts session['session_id']
27
- uuid = params['layer_slug_s']
28
- layername = params['layer_id_s']
29
- wfsurl = params['solr_wfs_url']
30
-
31
- params = {:service => 'wfs', :version => '2.0.0', :request => 'GetFeature', :srsName => 'EPSG:4326', :outputformat => 'SHAPE-ZIP', :typeName => layername}
32
-
33
- # token = SecureRandom.base64(8).tr('+/=lIO0', 'abc123')
34
- error = ''
35
-
36
- if !Dir.exists?('tmp/data')
37
- Dir.mkdir('tmp/data')
38
- end
39
- if (!File.file?("tmp/data/#{uuid}-shapefile.zip"))
40
- File.open("tmp/data/#{uuid}-shapefile.zip", 'wb') do |f|
41
- puts "#{uuid}-shapefile.zip created"
42
- dl = HTTParty.get(wfsurl, :query => params)
43
- if dl.headers['content-type'] == 'application/zip'
44
- f.write dl.parsed_response
45
- else
46
- error = dl.parsed_response
47
- end
48
- end
49
- else
50
- puts "#{uuid}-shapefile.zip already exists"
51
- end
52
- respond_to do |format|
53
- if error.length > 0
54
- puts 'error!'
55
- format.json { render :json => {:error => error}}
56
- File.delete("tmp/data/#{uuid}-shapefile.zip")
57
- puts "#{uuid}-shapefile.zip deleted"
58
- else
59
- format.json { render :json => {:data => "#{uuid}-shapefile.zip"}}
60
- end
18
+ def check_type
19
+ case params[:type]
20
+ when 'shapefile'
21
+ response = ShapefileDownload.new(@document).get
22
+ when 'kmz'
23
+ response = KmzDownload.new(@document).get
61
24
  end
62
-
25
+ response
63
26
  end
64
27
 
65
- def kml
66
- layername = params['layer_id_s']
67
- puts layername
68
- bbox = [params['solr_sw_pt_1_d'], params['solr_sw_pt_0_d'], params['solr_ne_pt_1_d'], params['solr_ne_pt_0_d']]
69
- bbox = bbox.join(',')
70
- wmsurl = params['solr_wms_url']
71
- uuid = params['layer_slug_s']
72
- puts bbox
73
-
74
- params = {:service => 'wms', :version => '1.1.0', :request => 'GetMap', :srsName => 'EPSG:900913', :format => 'application/vnd.google-earth.kmz', :layers => layername, :bbox => bbox, :width => 2000, :height => 2000}
75
-
76
- error = ''
77
-
78
- if !Dir.exists?('tmp/data')
79
- Dir.mkdir('tmp/data')
80
- end
81
- if (!File.file?("tmp/data/#{uuid}.kmz"))
82
- File.open("tmp/data/#{uuid}.kmz", 'wb') do |f|
83
- puts "#{uuid}.kmz created"
84
- dl = HTTParty.get(wmsurl, :query => params)
85
- puts dl.headers.inspect
86
- puts dl.request.inspect
87
- if dl.headers['content-type'] == 'application/vnd.google-earth.kmz'
88
- f.write dl.parsed_response
89
- else
90
- error = dl.parsed_response
91
- end
92
- end
28
+ def validate(response)
29
+ if response.nil?
30
+ flash[:danger] = t 'geoblacklight.download.error'
93
31
  else
94
- puts "#{uuid}.kmz already exists"
95
- end
96
- respond_to do |format|
97
- if error.length > 0
98
- puts 'error!'
99
- format.json { render :json => {:error => error}}
100
- File.delete("tmp/data/#{uuid}.kmz")
101
- puts "#{uuid}.kmz deleted"
102
- else
103
- format.json { render :json => {:data => "#{uuid}.kmz"}}
104
- end
32
+ flash[:success] = view_context.link_to(t('geoblacklight.download.success', title: response), download_file_path(response))
105
33
  end
106
34
  end
107
35
  end
@@ -1,81 +1,9 @@
1
- require 'nokogiri'
2
-
3
- class Layer
4
- include HTTParty
5
- format :json
6
-
7
- def self.getInfo(params)
8
- url = params['URL']
9
- params['BBOX'] = formatLatLng(params['BBOX'])
10
- # puts 'hallo'
11
- # params.delete "URL"
12
- params.delete "action"
13
- params.delete "controller"
14
- puts params
15
- get(url, :query => params.except('URL'))
16
- end
17
- end
18
-
19
- # Refactor to a helper later on
20
- def formatLatLng(val)
21
- formated_val = []
22
- val.split(',').each do |v|
23
- vFloat = v.to_f
24
- if vFloat > 180 || vFloat < -180
25
- while vFloat > 180
26
- vFloat -= 360
27
- end
28
- while vFloat < -180
29
- vFloat += 360
30
- end
31
- formated_val.push(vFloat)
32
- else
33
- formated_val.push(v)
34
- end
35
- end
36
- return formated_val.join(',')
37
- end
38
-
39
1
  class WmsController < ApplicationController
40
2
  def handle
41
- params["info_format"] = "text/html"
42
- response = Layer.getInfo(params)
43
- # puts response.inspect
44
- puts response.body
45
- puts response.request.inspect
46
-
47
-
48
- page = Nokogiri::HTML(response.body)
49
- table = {:values => []}
50
- page.css('th').each_with_index do |th|
51
- table[:values].push([th.text])
52
- end
53
- page.css('td').each_with_index do |td, i|
54
- table[:values][i].push(td.text)
55
- end
56
-
57
- errorresponse = {}
58
-
59
- if response.headers["content-type"].slice(0,8) == "text/xml"
60
- puts response.body.to_s
61
- errorresponse = Hash.from_xml(response.body).to_json
62
- end
3
+ response = WmsLayer.new(params).get_feature_info
63
4
 
64
5
  respond_to do |format|
65
- if response.headers["content-type"].slice(0,9) == "text/html"
66
- format.json { render :json => table}
67
- else
68
- format.json { render :json => errorresponse}
69
- end
70
- # if response.headers["content-type"] == "application/json"
71
- # format.json { render :json => response }
72
- # else
73
- # if response.headers["content-type"] == "text/html"
74
- # puts 'should be called'
75
- # format.json { render :json => table}
76
- # end
77
- # # format.json { render :json => {"code" => "fail"}}
78
- # end
6
+ format.json { render json: response }
79
7
  end
80
8
  end
81
9
  end
@@ -5,15 +5,15 @@ module GeoblacklightHelper
5
5
  end
6
6
 
7
7
  def sms_helper()
8
- content_tag(:i, '', :class => 'fa fa-li fa-mobile') + t('blacklight.tools.sms')
8
+ content_tag(:i, '', :class => 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
9
9
  end
10
10
 
11
11
  def email_helper
12
- content_tag(:i, '', :class => 'fa fa-li fa-envelope') + t('blacklight.tools.email')
12
+ content_tag(:i, '', :class => 'fa fa-envelope fa-fw') + ' ' + t('blacklight.tools.email')
13
13
  end
14
14
 
15
15
  def metadata_helper
16
- content_tag(:i, '', :class => 'fa fa-li fa-download') + t('Metadata')
16
+ content_tag(:i, '', :class => 'fa fa-download fa-fw') + ' ' + t('Metadata')
17
17
  end
18
18
 
19
19
  def abstract_truncator(abstract)
@@ -40,47 +40,17 @@ module GeoblacklightHelper
40
40
  end
41
41
 
42
42
  def layer_type_image(type)
43
- case type
44
- when "Polygon"
45
- image_tag('geoblacklight/type_polygon.png', 'data-toggle' => 'tooltip', title: 'Polygon', :class => 'tooltip-icon')
46
- when "Line"
47
- image_tag('geoblacklight/type_arc.png', 'data-toggle' => 'tooltip', title: 'Line', :class => 'tooltip-icon')
48
- when "Point"
49
- image_tag('geoblacklight/type_dot.png', 'data-toggle' => 'tooltip', title: 'Point', :class => 'tooltip-icon')
50
- when "Raster"
51
- image_tag('geoblacklight/type_raster.png', 'data-toggle' => 'tooltip', title: 'Raster', :class => 'tooltip-icon')
52
- when "Paper Map"
53
- image_tag('geoblacklight/type_map.png', 'data-toggle' => 'tooltip', title: 'Paper Map', :class => 'tooltip-icon')
54
- when "LibraryRecord"
55
- content_tag(:i, '', class: 'fa fa-book fa-lg text-muted tooltip-icon', 'data-toggle' => 'tooltip', title: 'Library Record')
56
- else
57
- ""
58
- end
43
+ content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{type.downcase}"
59
44
  end
60
45
 
61
46
  def layer_institution_image(institution)
62
- case institution
63
- when /Stanford/
64
- image_tag('geoblacklight/src_stanford.png', 'data-toggle' => 'tooltip', title: 'Stanford', :class => 'tooltip-icon')
65
- when /Berkeley/
66
- image_tag('geoblacklight/src_berkeley.png', 'data-toggle' => 'tooltip', title: 'UC Berkeley', :class => 'tooltip-icon')
67
- when /Harvard/
68
- image_tag('geoblacklight/src_harvard.png', 'data-toggle' => 'tooltip', title: 'Harvard', :class => 'tooltip-icon')
69
- when /MIT/
70
- image_tag('geoblacklight/src_mit.png', 'data-toggle' => 'tooltip', title: 'MIT', :class => 'tooltip-icon')
71
- when /Tufts/
72
- image_tag('geoblacklight/src_tufts.png', 'data-toggle' => 'tooltip', title: 'Tufts', :class => 'tooltip-icon')
73
- when /MassGIS/
74
- image_tag('geoblacklight/src_massgis.png', 'data-toggle' => 'tooltip', title: 'MassGIS', :class => 'tooltip-icon')
75
- else
76
- ""
77
- end
47
+ content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{institution.downcase}"
78
48
  end
79
49
 
80
50
  def layer_access_image(access)
81
51
  case access
82
52
  when 'Restricted'
83
- content_tag(:i, '', class: 'fa fa-lock fa-lg text-muted tooltip-icon', 'data-toggle' => 'tooltip', title: 'Restricted')
53
+ content_tag(:i, '', class: 'fa fa-lock fa-lg text-muted tooltip-icon', 'data-toggle' => 'tooltip', title: 'Restricted', style: 'width: 17px;')
84
54
  when 'Public'
85
55
  content_tag(:i, '', class: 'fa fa-unlock fa-lg text-muted tooltip-icon', 'data-toggle' => 'tooltip', title: 'Public')
86
56
  else
@@ -0,0 +1,4 @@
1
+ <div id="documents" class="docView col-md-6">
2
+ <%= render documents, :as => :document %>
3
+ </div>
4
+ <%= content_tag :div, '', id: 'map', data: { map: 'index', 'catalog-path'=> catalog_index_path , 'map-bbox' => params[:bbox] } %>
@@ -1,40 +1,3 @@
1
- <div class="row">
2
- <div class="col-md-6">
3
- <div class="panel panel-default">
4
- <div class="panel-heading">
5
- <h4><%= t('blacklight.welcome') %></h4>
6
- </div>
7
- <div class="panel-body">
8
- <p>
9
- Find GIS data!
10
- </p>
11
- <p>
12
- Discover Maps!
13
- </p>
14
- </div>
15
- </div>
16
- </div>
17
- <div class="col-md-6">
18
- <div class="panel panel-default">
19
- <div class="panel-heading">
20
- <h4>Featured Datasets</h4>
21
- </div>
22
- <div class="panel-body">
23
- <ul>
24
- <li>
25
- <a href="#">Amazing Data 1</a>
26
- </li>
27
- <li>
28
- <a href="#">Amazing Data 2</a>
29
- </li>
30
- <li>
31
- <a href="#">Amazing Data 3</a>
32
- </li>
33
- </ul>
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- <div id='geoblacklight-map-home'>
39
- <div id='map' class='mapview-map'></div>
1
+ <div id='row'>
2
+ <%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> catalog_index_path , 'map-bbox' => params[:bbox]} %>
40
3
  </div>
@@ -0,0 +1,24 @@
1
+ <% # header bar for doc items in index view -%>
2
+ <%= content_tag :div, class: 'documentHeader row', data: { layer_id: document[:uuid], bbox: document[:solr_bbox], geom: document[:solr_geom] } do %>
3
+ <div class='status-icons'>
4
+ <%= layer_type_image(document['layer_geom_type_s']) %>
5
+ <%= layer_institution_image(document['dct_provenance_s']) %>
6
+ <%= layer_access_image(document['dc_rights_s']) %>
7
+ </div>
8
+ <h5 class="index_title col-sm-9s cosl-lg-10 text-span">
9
+ <% counter = document_counter_with_offset(document_counter) %>
10
+ <span class="document-counter">
11
+ <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
12
+ </span>
13
+ <%= link_to_document document, :label=>document_show_link_field(document), :counter => counter, :title => document['dc_title_s'] %>
14
+ </h5>
15
+
16
+ <div class='col-md-12 more-info-area'>
17
+ <div class='collapse' data-collapse-target="<%= document['uuid'] %>">
18
+ <small>
19
+ <%= document['solr_year_i'] %>. <i><%= document['dc_creator_sm'].nil?? '' : document['dc_creator_sm'].join(', ') %></i>. <%= snippit(document['dc_description_s']) %>. <%= document['dc_publisher_s'] %>. Score: <%= document['score'] %>
20
+ </small>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+
@@ -1,68 +1,15 @@
1
- <div class="geoblacklight-view-panel">
2
- <small>
3
- <%= layer_type_image(document['layer_geom_type_s']) %>
4
- <%= layer_institution_image(document['dct_provenance_s']) %>
5
- <%= layer_access_image(document['dc_rights_s']) %>
6
- </small>
1
+ <% document ||= @document %>
7
2
 
8
- <dl class="dl-horizontal">
9
- <% unless document['dc_creator_sm'].nil? %>
10
- <dt>Author</dt>
11
- <dd><%= document['dc_creator_sm'].join(', ') %>&nbsp;</dd>
12
- <% end %>
13
- <% unless document['dc_publisher_s'].nil? %>
14
- <dt>Publisher</dt>
15
- <dd><%= document['dc_publisher_s'] %>&nbsp;</dd>
16
- <% end %>
17
- <dt>Year</dt>
18
- <dd><%= document['solr_year_i'] %>&nbsp;</dd>
19
- <dt>Abstract</dt>
20
- <dd id=""><%= abstract_truncator(document['dc_description_s']) %>&nbsp;</dd>
21
- <% unless document['dct_isPartOf_sm'].nil? %>
22
- <dt>Collection</dt>
23
- <dd><%= document['dct_isPartOf_sm'].sort.join(', ') %>&nbsp;</dd>
24
- <% end %>
25
- <% if document['dct_provenance_s'] == 'Stanford' and not document['dc_identifier_s'].nil? %>
26
- <dt>Citation</dt>
27
- <dd><%= link_to document['dc_identifier_s'], document['dc_identifier_s'] %>&nbsp;</dd>
28
- <% end %>
29
- <% unless document['dct_spatial_sm'].nil? %>
30
- <dt>Places</dt>
31
- <dd><%= document['dct_spatial_sm'].sort.join(', ') %>&nbsp;</dd>
32
- <% end %>
33
- <% unless document['dc_subject_sm'].nil? %>
34
- <dt>Subjects</dt>
35
- <dd><%= document['dc_subject_sm'].sort.join(', ') %>&nbsp;</dd>
36
- <% end %>
37
- <% unless document['dct_temporal_sm'].nil? %>
38
- <dt>Years</dt>
39
- <dd><%= document['dct_temporal_sm'].sort.join(', ') %>&nbsp;</dd>
40
- <% end %>
41
- </dl>
42
- </div>
3
+ <%= render 'upper_metadata', locals: { document: document} %>
43
4
 
44
5
  <div class='row'>
45
6
  <div class="col-md-8">
46
- <div id='geoblacklight-map-view'>
47
- <div id='map' class='mapview-map'></div>
7
+ <%= content_tag :div, id: 'map', data: { map: 'item', 'catalog-path'=> catalog_index_path , 'map-bbox' => document[:solr_bbox], 'layer-id' => document[:layer_id_s], 'wms-url' => document[:solr_wms_url], available: document.available? } do %>
48
8
  <div id='control'>
49
9
  <div id='handle'></div>
50
10
  <div id='bottom'></div>
51
11
  </div>
52
- </div>
12
+ <% end %>
53
13
  </div>
54
14
  <div id='table-container' class='col-md-4'><div id='attribute-table' ></div></div>
55
15
  </div>
56
- <% if @document['dct_provenance_s'] == 'Stanford' %>
57
- <div class='geoblacklight-view-panel-footer'>
58
- <br>
59
- <br>
60
- <hr/>
61
- <p align="right">
62
- <small>
63
- <a href="<%= @document['dc_identifier_s'] %>.mods">Librarian View</a>
64
- </small>
65
- </p>
66
- </div>
67
- <% end %>
68
- <%= javascript_tag "var solrDoc = #{@document.to_json};" %>