geoblacklight 1.9.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -2
  3. data/.rubocop.yml +4 -14
  4. data/.rubocop_todo.yml +51 -48
  5. data/README.md +3 -0
  6. data/Rakefile +1 -2
  7. data/app/assets/javascripts/geoblacklight/basemaps.js +3 -3
  8. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  9. data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
  10. data/app/assets/javascripts/geoblacklight/modules/download.js +1 -1
  11. data/app/assets/javascripts/geoblacklight/modules/home.js +3 -2
  12. data/app/assets/javascripts/geoblacklight/modules/util.js +8 -0
  13. data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +19 -0
  14. data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +15 -13
  15. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +3 -3
  16. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +4 -2
  17. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +20 -12
  18. data/app/assets/javascripts/geoblacklight/viewers/map.js +2 -1
  19. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -5
  20. data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +43 -0
  21. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +4 -1
  22. data/app/assets/stylesheets/geoblacklight/application.scss +0 -1
  23. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +33 -13
  24. data/app/assets/stylesheets/geoblacklight/modules/home.scss +22 -19
  25. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +1 -1
  26. data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +7 -0
  27. data/app/assets/stylesheets/geoblacklight/modules/item.scss +7 -8
  28. data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +9 -0
  29. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +15 -0
  30. data/app/assets/stylesheets/geoblacklight/modules/results.scss +7 -2
  31. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +60 -0
  32. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +55 -35
  33. data/app/controllers/download_controller.rb +5 -4
  34. data/app/controllers/relation_controller.rb +11 -1
  35. data/app/helpers/carto_helper.rb +2 -9
  36. data/app/helpers/geoblacklight_helper.rb +15 -28
  37. data/app/models/concerns/geoblacklight/solr_document.rb +4 -0
  38. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +18 -1
  39. data/app/presenters/geoblacklight/document_presenter.rb +2 -2
  40. data/app/views/catalog/_document_action.html.erb +2 -2
  41. data/app/views/catalog/_document_split.html.erb +5 -3
  42. data/app/views/catalog/_downloads_secondary.html.erb +39 -0
  43. data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
  44. data/app/views/catalog/_home_text.html.erb +30 -38
  45. data/app/views/catalog/_index_split_default.html.erb +1 -2
  46. data/app/views/catalog/_metadata.html.erb +3 -3
  47. data/app/views/catalog/_show_default_attribute_table.html.erb +16 -14
  48. data/app/views/catalog/_show_default_viewer_container.html.erb +5 -3
  49. data/app/views/catalog/_show_default_viewer_information.html.erb +3 -1
  50. data/app/views/catalog/_show_downloads.html.erb +12 -9
  51. data/app/views/catalog/_show_tools.html.erb +25 -0
  52. data/app/views/catalog/_web_services.html.erb +1 -1
  53. data/app/views/catalog/_web_services_wfs.html.erb +1 -1
  54. data/app/views/catalog/_web_services_wms.html.erb +1 -1
  55. data/app/views/catalog/index.html.erb +9 -8
  56. data/app/views/relation/_ancestors.html.erb +2 -2
  57. data/app/views/relation/_descendants.html.erb +3 -3
  58. data/app/views/relation/index.html.erb +8 -8
  59. data/app/views/shared/_header_navbar.html.erb +28 -17
  60. data/config/locales/geoblacklight.en.yml +2 -2
  61. data/geoblacklight.gemspec +5 -4
  62. data/lib/generators/geoblacklight/install_generator.rb +3 -12
  63. data/lib/generators/geoblacklight/templates/Procfile +3 -0
  64. data/lib/generators/geoblacklight/templates/catalog_controller.rb +33 -5
  65. data/lib/generators/geoblacklight/templates/package.json +14 -0
  66. data/lib/generators/geoblacklight/templates/settings.yml +15 -1
  67. data/lib/generators/geoblacklight/templates/webpacker.yml +67 -0
  68. data/lib/generators/geoblacklight/webpacker_generator.rb +35 -0
  69. data/lib/geoblacklight.rb +2 -4
  70. data/lib/geoblacklight/controller_override.rb +27 -22
  71. data/lib/geoblacklight/engine.rb +0 -1
  72. data/lib/geoblacklight/version.rb +1 -1
  73. data/lib/tasks/geoblacklight.rake +18 -0
  74. data/schema/geoblacklight-schema.md +72 -59
  75. data/schema/geometry-type-values.md +1 -0
  76. data/schema/references.md +22 -0
  77. data/schema/schema-commentary.md +198 -0
  78. data/schema/subjects.md +41 -0
  79. data/schema/type-values.md +4 -2
  80. data/solr/conf/core.properties +5 -0
  81. data/solr/conf/schema.xml +11 -1
  82. data/solr/conf/solrconfig.xml +1 -1
  83. data/spec/controllers/catalog_controller_spec.rb +17 -1
  84. data/spec/factories/user.rb +2 -2
  85. data/spec/features/download_layer_spec.rb +19 -15
  86. data/spec/features/esri_viewer_spec.rb +2 -2
  87. data/spec/features/home_page_spec.rb +6 -2
  88. data/spec/features/index_map_spec.rb +15 -25
  89. data/spec/features/layer_opacity_spec.rb +1 -1
  90. data/spec/features/layer_preview_spec.rb +3 -2
  91. data/spec/features/linkified_attribute_table_spec.rb +3 -4
  92. data/spec/features/relations_spec.rb +1 -1
  93. data/spec/features/search_bar_spec.rb +2 -2
  94. data/spec/features/search_results_map_spec.rb +2 -2
  95. data/spec/features/search_results_overlap_ratio_spec.rb +55 -0
  96. data/spec/features/search_spec.rb +13 -0
  97. data/spec/features/show_page_metadata_spec.rb +1 -1
  98. data/spec/features/sms_spec.rb +15 -0
  99. data/spec/features/split_view.html.erb_spec.rb +24 -15
  100. data/spec/features/web_services_modal_spec.rb +0 -2
  101. data/spec/fixtures/solr_documents/README.md +38 -0
  102. data/spec/fixtures/solr_documents/esri-image-map-layer.json +39 -18
  103. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +37 -0
  104. data/spec/fixtures/solr_documents/index-map-polygon.json +37 -0
  105. data/spec/fixtures/solr_documents/{point_index_map.json → index_map_point.json} +1 -1
  106. data/spec/fixtures/solr_documents/princeton-child1.json +30 -0
  107. data/spec/fixtures/solr_documents/princeton-child2.json +30 -0
  108. data/spec/fixtures/solr_documents/princeton-parent.json +25 -0
  109. data/spec/helpers/carto_helper_spec.rb +1 -20
  110. data/spec/helpers/geoblacklight_helper_spec.rb +4 -22
  111. data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
  112. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -1
  113. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +10 -0
  114. data/spec/spec_helper.rb +6 -3
  115. data/spec/teaspoon_env.rb +31 -1
  116. data/spec/test_app_templates/lib/generators/test_app_generator.rb +5 -0
  117. data/spec/test_app_templates/solr_documents +1 -0
  118. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -1
  119. data/spec/views/catalog/_show_tools.html.erb_spec.rb +39 -0
  120. data/template.rb +4 -2
  121. data/vendor/assets/images/layers-2x.png +0 -0
  122. data/vendor/assets/images/layers.png +0 -0
  123. data/vendor/assets/images/marker-icon-2x.png +0 -0
  124. data/vendor/assets/images/marker-icon.png +0 -0
  125. data/vendor/assets/images/marker-shadow.png +0 -0
  126. data/vendor/assets/javascripts/esri-leaflet.js.map +1 -0
  127. data/vendor/assets/javascripts/leaflet-src.js.map +1 -0
  128. data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
  129. data/vendor/assets/stylesheets/leaflet.css +635 -0
  130. metadata +87 -33
  131. data/app/assets/stylesheets/geoblacklight/modules/twitter-typeahead.scss +0 -14
  132. data/app/views/catalog/_search_form_no_navbar.html.erb +0 -22
  133. data/app/views/catalog/_show_default.html.erb +0 -13
  134. data/app/views/catalog/_upper_metadata.html.erb +0 -20
  135. data/spec/fixtures/solr_documents/umn_metro_result2.json +0 -39
@@ -0,0 +1,60 @@
1
+ // Mixins and shared properties for sidebar elements
2
+
3
+ @mixin sidebar-children {
4
+ %list-group-item-children {
5
+ padding: 10px, 15px;
6
+ }
7
+
8
+ %list-group-item-anchors {
9
+ text-align: center;
10
+ width: 1.4em;
11
+ }
12
+
13
+ margin-top: 16px;
14
+ margin-bottom: 16px;
15
+
16
+ .card-header {
17
+ h2 {
18
+ display: inline-block;
19
+ padding-top: 8px;
20
+ padding-bottom: 8px;
21
+ margin-bottom: 0px;
22
+ font-size: 1rem;
23
+ }
24
+ }
25
+
26
+ .card-subtitle {
27
+ margin: 1rem 0 .2rem;
28
+ font-size: .9rem;
29
+ font-weight: normal;
30
+ color: $gray-600;
31
+ }
32
+
33
+ .list-group {
34
+ padding-top: 24px;
35
+ padding-bottom: 24px;
36
+ padding-left: 4px;
37
+ padding-right: 4px;
38
+
39
+ .list-group-item {
40
+ border-color: $white;
41
+ padding: 8px 16px;
42
+
43
+ a {
44
+ @extend %list-group-item-children;
45
+
46
+ .geoblacklight {
47
+ color: $gray-600;
48
+ }
49
+ }
50
+ }
51
+
52
+ &-nested {
53
+ padding: 0;
54
+
55
+ .list-group-item {
56
+ padding: 8px 0;
57
+ }
58
+ }
59
+ }
60
+ }
@@ -1,46 +1,66 @@
1
1
  .show-tools {
2
- a .geoblacklight {
3
- color: $gray-light;
4
- }
2
+ @include sidebar-children;
5
3
 
6
- .geoblacklight-citation {
7
- text-align: center;
8
- width: 1.4em;
9
- }
4
+ .list-group {
10
5
 
11
- .geoblacklight-data-dictionary {
12
- text-align: center;
13
- width: 1.4em;
14
- }
6
+ .list-group-item {
15
7
 
16
- .geoblacklight-sms {
17
- text-align: center;
18
- width: 1.4em;
19
- }
8
+ form {
9
+ @extend %list-group-item-children;
20
10
 
21
- .geoblacklight-email {
22
- text-align: center;
23
- width: 1.4em;
24
- }
11
+ .checkbox {
12
+ margin-left: 4px;
13
+ margin-right: 4px;
25
14
 
26
- .geoblacklight-web_services {
27
- text-align: center;
28
- width: 1.4em;
29
- }
15
+ label {
16
+ margin-bottom: inherit;
17
+ }
18
+ }
19
+ }
30
20
 
31
- .geoblacklight-metadata {
32
- text-align: center;
33
- width: 1.4em;
34
- }
21
+ a {
35
22
 
36
- .geoblacklight-carto {
37
- text-align: center;
38
- width: 1.4em;
39
- }
23
+ .geoblacklight {
24
+
25
+ &-citation {
26
+ @extend %list-group-item-anchors;
27
+ }
28
+
29
+ &-data-dictionary {
30
+ @extend %list-group-item-anchors;
31
+ }
32
+
33
+ &-sms {
34
+ @extend %list-group-item-anchors;
35
+ }
36
+
37
+ &-email {
38
+ @extend %list-group-item-anchors;
39
+ }
40
+
41
+ &-web_services {
42
+ @extend %list-group-item-anchors;
43
+ }
44
+
45
+ &-metadata {
46
+ @extend %list-group-item-anchors;
47
+ }
48
+
49
+ &-carto {
50
+ @extend %list-group-item-anchors;
51
+ }
52
+
53
+ // DEPRECATED: Will be removed in GeoBlacklight v2.0
54
+ &-cartodb {
55
+ @extend %list-group-item-anchors;
56
+ }
57
+ }
58
+ }
59
+ }
40
60
 
41
- // DEPRECATED: Will be removed in GeoBlacklight v2.0
42
- .geoblacklight-cartodb {
43
- text-align: center;
44
- width: 1.4em;
61
+ .downloads {
62
+ margin-left: 4px;
63
+ margin-right: 4px;
64
+ }
45
65
  }
46
66
  }
@@ -1,5 +1,6 @@
1
1
  class DownloadController < ApplicationController
2
- include Blacklight::SearchHelper
2
+ # include Blacklight::SearchHelper
3
+ include Blacklight::Catalog
3
4
 
4
5
  rescue_from Geoblacklight::Exceptions::ExternalDownloadFailed do |exception|
5
6
  Geoblacklight.logger.error exception.message + ' ' + exception.url
@@ -18,7 +19,7 @@ class DownloadController < ApplicationController
18
19
  end
19
20
 
20
21
  def show
21
- @response, @document = fetch params[:id]
22
+ @response, @document = search_service.fetch params[:id]
22
23
  restricted_should_authenticate
23
24
  response = check_type
24
25
  validate response
@@ -30,13 +31,13 @@ class DownloadController < ApplicationController
30
31
 
31
32
  def file
32
33
  # Grab the solr document to check if it should be public or not
33
- @response, @document = fetch(file_name_to_id(params[:id]))
34
+ @response, @document = search_service.fetch(file_name_to_id(params[:id]))
34
35
  restricted_should_authenticate
35
36
  send_file download_file_path_and_name, x_sendfile: true
36
37
  end
37
38
 
38
39
  def hgl
39
- @response, @document = fetch params[:id]
40
+ @response, @document = search_service.fetch params[:id]
40
41
  if params[:email]
41
42
  response = Geoblacklight::HglDownload.new(@document, params[:email]).get
42
43
  if response.nil?
@@ -1,10 +1,20 @@
1
1
  class RelationController < ApplicationController
2
2
  include Blacklight::Configurable
3
- include Blacklight::SearchHelper
3
+ # include Blacklight::SearchHelper
4
4
  copy_blacklight_config_from(CatalogController)
5
5
 
6
6
  def index
7
7
  @relations = Geoblacklight::Relation::RelationResponse.new(params[:id], repository)
8
8
  render layout: !request.xhr?
9
9
  end
10
+
11
+ private
12
+
13
+ def repository_class
14
+ blacklight_config.repository_class
15
+ end
16
+
17
+ def repository
18
+ @repository ||= repository_class.new(blacklight_config)
19
+ end
10
20
  end
@@ -1,6 +1,6 @@
1
1
  module CartoHelper
2
2
  ##
3
- # Creates a Carto OneClick link link, using the configuration link
3
+ # Creates a Carto OneClick link, using the configuration link
4
4
  # @param [String] file_link
5
5
  # @return [String]
6
6
  def carto_link(file_link)
@@ -24,13 +24,6 @@ module CartoHelper
24
24
  ##
25
25
  # Method used to access setting and provide deprecation warnings to migrate
26
26
  def carto_oneclick_host
27
- if Settings.CARTODB_ONECLICK_LINK.present?
28
- Deprecation.warn(
29
- GeoblacklightHelper,
30
- 'Settings.CARTODB_ONECLICK_LINK is deprecated and will be removed in ' \
31
- 'Geoblacklight 2.0.0, use Settings.CARTO_ONECLICK_LINK instead'
32
- )
33
- end
34
- Settings.CARTO_ONECLICK_LINK || Settings.CARTODB_ONECLICK_LINK
27
+ Settings.CARTO_ONECLICK_LINK
35
28
  end
36
29
  end
@@ -1,15 +1,4 @@
1
1
  module GeoblacklightHelper
2
- extend Deprecation
3
- self.deprecation_horizon = 'Geoblacklight 2.0.0'
4
-
5
- def sms_helper
6
- content_tag(:i, '', class: 'fa fa-mobile fa-fw') + ' ' + t('blacklight.tools.sms')
7
- end
8
-
9
- def email_helper
10
- content_tag(:i, '', class: 'fa fa-envelope fa-fw') + ' ' + t('blacklight.tools.email')
11
- end
12
-
13
2
  def document_available?
14
3
  @document.public? || (@document.same_institution? && user_signed_in?)
15
4
  end
@@ -27,7 +16,7 @@ module GeoblacklightHelper
27
16
  text,
28
17
  document.direct_download[:download],
29
18
  'contentUrl' => document.direct_download[:download],
30
- class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-original'],
19
+ class: ['btn', 'btn-default', 'download', 'download-original'],
31
20
  data: {
32
21
  download: 'trigger',
33
22
  download_type: 'direct',
@@ -40,9 +29,9 @@ module GeoblacklightHelper
40
29
  link_to(
41
30
  text,
42
31
  download_hgl_path(id: document),
43
- class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-original'],
32
+ class: ['btn', 'btn-default', 'download', 'download-original'],
44
33
  data: {
45
- ajax_modal: 'trigger',
34
+ blacklight_modal: 'trigger',
46
35
  download: 'trigger',
47
36
  download_type: 'harvard-hgl',
48
37
  download_id: document.id
@@ -57,7 +46,7 @@ module GeoblacklightHelper
57
46
  download_text('JPG'),
58
47
  iiif_jpg_url,
59
48
  'contentUrl' => iiif_jpg_url,
60
- class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-generated'],
49
+ class: ['btn', 'btn-default', 'download', 'download-generated'],
61
50
  data: {
62
51
  download: 'trigger'
63
52
  }
@@ -68,7 +57,7 @@ module GeoblacklightHelper
68
57
  link_to(
69
58
  t('geoblacklight.download.export_link', download_format: proper_case_format(download_type)),
70
59
  '',
71
- class: ['btn', 'btn-primary', 'btn-block', 'download', 'download-generated'],
60
+ class: ['btn', 'btn-default', 'download', 'download-generated'],
72
61
  data: {
73
62
  download_path: download_path(document.id, type: download_type),
74
63
  download: 'trigger',
@@ -100,10 +89,6 @@ module GeoblacklightHelper
100
89
  title: name
101
90
  end
102
91
 
103
- def render_search_form_no_navbar
104
- render partial: 'catalog/search_form_no_navbar'
105
- end
106
-
107
92
  ##
108
93
  # Renders an unique array of search links based off of terms
109
94
  # passed in using the facet parameter
@@ -179,14 +164,6 @@ module GeoblacklightHelper
179
164
  blacklight_config.basemap_provider || 'positron'
180
165
  end
181
166
 
182
- ##
183
- # Removes blank space from provider to accomodate CartoDB OneClick
184
- # @deprecated Use {#carto_provider} instead.
185
- def cartodb_provider
186
- carto_provider
187
- end
188
- deprecation_deprecate cartodb_provider: 'use GeoblacklightHelper#carto_provider instead'
189
-
190
167
  ##
191
168
  # Creates a Carto OneClick link link, using the configuration link
192
169
  # @param [String] file_link
@@ -252,4 +229,14 @@ module GeoblacklightHelper
252
229
  def first_metadata?(document, metadata)
253
230
  document.references.shown_metadata.first.type == metadata.type
254
231
  end
232
+
233
+ ##
234
+ # Renders a reference url for a document
235
+ # @param [Hash] document, field_name
236
+ def render_references_url(args)
237
+ link_to(
238
+ args[:document].references.url.endpoint,
239
+ args[:document].references.url.endpoint
240
+ ) if args[:document]&.references&.url
241
+ end
255
242
  end
@@ -51,6 +51,10 @@ module Geoblacklight
51
51
  references.data_dictionary.to_hash unless references.data_dictionary.blank?
52
52
  end
53
53
 
54
+ def external_url
55
+ references.url.endpoint if references.url
56
+ end
57
+
54
58
  def item_viewer
55
59
  ItemViewer.new(references)
56
60
  end
@@ -3,7 +3,7 @@ module Geoblacklight
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- self.default_processor_chain += [:add_spatial_params]
6
+ self.default_processor_chain += [:add_spatial_params, :hide_suppressed_records]
7
7
  end
8
8
 
9
9
  ##
@@ -18,6 +18,12 @@ module Geoblacklight
18
18
  solr_params[:bq] << "#{Settings.FIELDS.GEOMETRY}:\"IsWithin(#{envelope_bounds})\"#{boost}"
19
19
  solr_params[:fq] ||= []
20
20
  solr_params[:fq] << "#{Settings.FIELDS.GEOMETRY}:\"Intersects(#{envelope_bounds})\""
21
+
22
+ if Settings.OVERLAP_RATIO_BOOST
23
+ solr_params[:overlap] =
24
+ "{!field uf=* defType=lucene f=solr_bboxtype score=overlapRatio}Intersects(#{envelope_bounds})"
25
+ solr_params[:bf] = "$overlap^#{Settings.OVERLAP_RATIO_BOOST}"
26
+ end
21
27
  end
22
28
  solr_params
23
29
  rescue Geoblacklight::Exceptions::WrongBoundingBoxFormat
@@ -43,5 +49,16 @@ module Geoblacklight
43
49
  def bounding_box
44
50
  Geoblacklight::BoundingBox.from_rectangle(blacklight_params[:bbox])
45
51
  end
52
+
53
+ ##
54
+ # Hide suppressed records in search
55
+ # @param [Blacklight::Solr::Request]
56
+ # @return [Blacklight::Solr::Request]
57
+ def hide_suppressed_records(solr_params)
58
+ # Show child records if searching for a specific source parent
59
+ return unless blacklight_params.fetch(:f, {})[Settings.FIELDS.SOURCE.to_sym].nil?
60
+ solr_params[:fq] ||= []
61
+ solr_params[:fq] << '-suppressed_b: true'
62
+ end
46
63
  end
47
64
  end
@@ -10,8 +10,8 @@ module Geoblacklight
10
10
  # @return [String]
11
11
  def index_fields_display
12
12
  fields_values = []
13
- @configuration.index_fields.each do |field_name, _|
14
- val = field_value(field_name)
13
+ @configuration.index_fields.each do |_field_name, field_config|
14
+ val = field_value(field_config)
15
15
  unless val.blank?
16
16
  val += '.' unless val.end_with?('.')
17
17
  fields_values << val
@@ -1,6 +1,6 @@
1
1
  <%= link_to document_action_path(document_action_config, (local_assigns.has_key?(:url_opts) ? url_opts : {}).merge(({id: document} if document) || {})),
2
2
  id: document_action_config.fetch(:id, "#{document_action_config.key}Link"),
3
- data: {}.merge(({ajax_modal: "trigger"} if document_action_config.modal != false) || {}) do %>
3
+ data: {}.merge(({blacklight_modal: "trigger"} if document_action_config.modal != false) || {}) do %>
4
4
  <%= content_tag :span, '', class: "geoblacklight geoblacklight-#{document_action_config.key}" %>
5
5
  <%= document_action_label(document_action_config.key, document_action_config) %>
6
- <% end %>
6
+ <% end %>
@@ -1,4 +1,6 @@
1
- <div id="documents" class="docView col-md-6">
2
- <%= render documents, :as => :document %>
1
+ <div class='row'>
2
+ <div id="documents" class="documents-list col-md-6">
3
+ <%= render documents, :as => :document %>
4
+ </div>
5
+ <%= content_tag :div, '', id: 'map', class: 'col-md-6', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
3
6
  </div>
4
- <%= content_tag :div, '', id: 'map', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %>
@@ -0,0 +1,39 @@
1
+ <%# Renders the secondary downloads displayed in the split dropdown %>
2
+ <% document ||= @document %>
3
+
4
+ <button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
5
+ <span class='caret'></span>
6
+ <span class='sr-only'>Toggle Download Dropdown</span>
7
+ </button>
8
+ <ul class='dropdown-menu' role='menu'>
9
+ <% if document.hgl_download.present? %>
10
+ <li role="presentation" class="dropdown-header">Original</li>
11
+ <li>
12
+ <%= link_to(download_text(document.download_types.first[0]),
13
+ download_hgl_path(id: document), data: {blacklight_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document.id }) %>
14
+ </li>
15
+ <% else %>
16
+ <% if document.direct_download.present? %>
17
+ <li role="presentation" class="dropdown-header">Original</li>
18
+ <li>
19
+ <%= link_to(download_text(@document.file_format), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document.id }) %>
20
+ </li>
21
+ <% end %>
22
+ <% if document.download_types.present? || document.iiif_download.present? %>
23
+ <li role="presentation" class="dropdown-header">Generated</li>
24
+ <% end %>
25
+ <% if document.iiif_download.present? %>
26
+ <li>
27
+ <%= link_to "Download JPG", iiif_jpg_url, download: 'trigger' %>
28
+ </li>
29
+ <% end %>
30
+
31
+ <% if document.download_types.present? %>
32
+ <% document.download_types.each do |type| %>
33
+ <%= content_tag(:li) do %>
34
+ <% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document.id, type: type[0])}", download: 'trigger', download_type: type[0], download_id: document.id }) %>
35
+ <% end %>
36
+ <% end %>
37
+ <% end %>
38
+ <% end %>
39
+ </ul>