geoblacklight_sidecar_images 0.9.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +7 -7
  3. data/.solr_wrapper.yml +0 -1
  4. data/README.md +13 -19
  5. data/app/assets/stylesheets/geoblacklight_sidecar_images/modules/_results.scss +32 -8
  6. data/app/models/concerns/wms_rewrite_concern.rb +1 -1
  7. data/app/services/geoblacklight_sidecar_images/image_service/wms.rb +1 -1
  8. data/app/services/geoblacklight_sidecar_images/image_service.rb +1 -1
  9. data/geoblacklight_sidecar_images.gemspec +7 -7
  10. data/lib/generators/geoblacklight_sidecar_images/config_generator.rb +1 -1
  11. data/lib/generators/geoblacklight_sidecar_images/helpers_generator.rb +21 -0
  12. data/lib/generators/geoblacklight_sidecar_images/install_generator.rb +7 -1
  13. data/lib/generators/geoblacklight_sidecar_images/jobs_generator.rb +1 -1
  14. data/lib/generators/geoblacklight_sidecar_images/models_generator.rb +1 -1
  15. data/lib/generators/geoblacklight_sidecar_images/templates/helpers/blacklight/layout_helper_behavior.rb +110 -0
  16. data/lib/generators/geoblacklight_sidecar_images/templates/views/catalog/_index_split_default.html.erb +25 -24
  17. data/lib/geoblacklight_sidecar_images/version.rb +1 -1
  18. data/lib/tasks/geoblacklight_sidecar_images_tasks.rake +1 -1
  19. data/solr/conf/schema.xml +60 -58
  20. data/solr/conf/solrconfig.xml +29 -29
  21. data/spec/fixtures/files/actual-polygon1.json +33 -18
  22. data/spec/fixtures/files/esri-dynamic-layer-all-layers.json +34 -25
  23. data/spec/fixtures/files/esri-image-map-layer.json +36 -26
  24. data/spec/fixtures/files/esri-tiled_map_layer.json +33 -18
  25. data/spec/fixtures/files/placeholder.json +38 -0
  26. data/spec/fixtures/files/public_iiif_princeton.json +41 -26
  27. data/spec/fixtures/files/umich_iiif_jpg.json +48 -25
  28. data/spec/fixtures/files/umn_iiif_jpg.json +57 -28
  29. data/spec/fixtures/files/umn_solr_thumb.json +59 -31
  30. data/spec/jobs/store_image_job_spec.rb +1 -1
  31. data/spec/lib/tasks/geoblacklight_sidecar_images_spec.rb +0 -1
  32. data/spec/models/solr_document_sidecar_spec.rb +1 -1
  33. data/spec/models/solr_document_spec.rb +1 -1
  34. data/spec/services/image_service_spec.rb +11 -1
  35. data/spec/spec_helper.rb +23 -10
  36. data/spec/test_app_templates/Gemfile.extra +2 -1
  37. data/template.rb +4 -4
  38. metadata +24 -56
  39. data/app/assets/stylesheets/geoblacklight_sidecar_images/application.scss +0 -10
  40. data/lib/generators/geoblacklight_sidecar_images/templates/gblsci.scss +0 -3
  41. data/spec/fixtures/files/actual-papermap1.json +0 -23
  42. data/spec/fixtures/files/actual-point1.json +0 -37
  43. data/spec/fixtures/files/actual-raster1.json +0 -38
  44. data/spec/fixtures/files/b1g_thumbnail.json +0 -42
  45. data/spec/fixtures/files/baruch_ancestor1.json +0 -46
  46. data/spec/fixtures/files/baruch_ancestor2.json +0 -46
  47. data/spec/fixtures/files/baruch_documentation_download.json +0 -49
  48. data/spec/fixtures/files/bbox-spans-180.json +0 -20
  49. data/spec/fixtures/files/cornell_html_metadata.json +0 -42
  50. data/spec/fixtures/files/esri-dynamic-layer-single-layer.json +0 -40
  51. data/spec/fixtures/files/esri-feature-layer.json +0 -46
  52. data/spec/fixtures/files/esri-wms-layer.json +0 -33
  53. data/spec/fixtures/files/harvard_raster.json +0 -44
  54. data/spec/fixtures/files/iiif-eastern-hemisphere.json +0 -30
  55. data/spec/fixtures/files/index-map-polygon-no-downloadurl.json +0 -37
  56. data/spec/fixtures/files/index-map-polygon.json +0 -37
  57. data/spec/fixtures/files/index-map-stanford.json +0 -37
  58. data/spec/fixtures/files/index_map_point.json +0 -27
  59. data/spec/fixtures/files/no_spatial.json +0 -21
  60. data/spec/fixtures/files/princeton-child1.json +0 -30
  61. data/spec/fixtures/files/princeton-child2.json +0 -30
  62. data/spec/fixtures/files/princeton-child3.json +0 -30
  63. data/spec/fixtures/files/princeton-child4.json +0 -30
  64. data/spec/fixtures/files/princeton-parent.json +0 -25
  65. data/spec/fixtures/files/public_direct_download.json +0 -34
  66. data/spec/fixtures/files/public_polygon_mit.json +0 -27
  67. data/spec/fixtures/files/restricted-line.json +0 -37
  68. data/spec/fixtures/files/umn_metro_result1.json +0 -41
  69. data/spec/fixtures/files/umn_metro_result2.json +0 -35
  70. data/spec/fixtures/files/umn_state_result1.json +0 -38
  71. data/spec/fixtures/files/umn_state_result2.json +0 -38
  72. data/spec/fixtures/files/uva_slug_colon.json +0 -25
  73. data/spec/rails_helper.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e5639a7fcc6c46a1279e6e6b14cb56dc63621039508d6c9df8f5543640c45fa
4
- data.tar.gz: c66f6117ac38255d36421a82b178ee8271f381bc494b085ab93bf7a35d71a1f0
3
+ metadata.gz: 07e87a85df004575b8fe2b6c5527b6207fc680063d365cc90f344cf458c36d66
4
+ data.tar.gz: 943c20ab4215221cfcdef614d2e1d8874b1f74a538e04eb812ab252f50453dd1
5
5
  SHA512:
6
- metadata.gz: b838949ffa7901dea148ff473387949df139a7c1e9106589f398cc1ca5bc447a4ba3d9b3eb813fd3dd6c8ebf473aca425cae716ca906b762d6200d70eb13e9e0
7
- data.tar.gz: 58d63dd4f5182d9f4a0b2f8b4a448234fcc8a1897c4041f7fdac1d98a04e47591f2edafc667a335eb5da50cd74aa35715855a924d0fbb548253243c3e5627ac9
6
+ metadata.gz: 3946c6b696da98e7293414f8cc273051c4933f6584cd0cece3b5eb6dc1af1ebe042cd287e8ba57b6c0ac1f251634f1cb563f3695a452448d3a4a478465be3a35
7
+ data.tar.gz: d8e8b2886ad18358a55c992edf1d5cbfe43bf53e613115ad72f5908096f34f476d058387c97d9afc97f8c955b58c570f0dd534aecd7b6285c8b1f1d6793edac8
@@ -12,14 +12,14 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- bundler_version: [2.1.1]
16
- faraday_version: ['~> 1.0']
15
+ bundler_version: [2.2.8]
16
+ faraday_version: ['~> 2.0']
17
17
  steps:
18
18
  - uses: actions/checkout@v2
19
19
  - name: Set up Ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
22
- ruby-version: 2.7
22
+ ruby-version: 3.3.1
23
23
  - name: Install bundler
24
24
  run: gem install bundler -v ${{ matrix.bundler_version }}
25
25
  - name: Install dependencies
@@ -33,10 +33,10 @@ jobs:
33
33
  runs-on: ubuntu-latest
34
34
  strategy:
35
35
  matrix:
36
- ruby_version: ["3.0","2.7"]
37
- rails_version: [7.0.4.2, 6.1.7.2]
38
- bundler_version: [2.1.1]
39
- faraday_version: ['~> 1.0']
36
+ ruby_version: [3.3.1]
37
+ rails_version: [7.1.3.2, 7.0.8.1]
38
+ bundler_version: [2.2.8]
39
+ faraday_version: ['~> 2.0']
40
40
 
41
41
  name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
42
42
  steps:
data/.solr_wrapper.yml CHANGED
@@ -1,4 +1,3 @@
1
- url: https://archive.apache.org/dist/lucene/solr/8.11.1/solr-8.11.1.tgz
2
1
  validate: false
3
2
  instance_dir: tmp/solr
4
3
  download_dir: tmp/solr
data/README.md CHANGED
@@ -19,8 +19,8 @@ This GeoBlacklight plugin captures remote images from geographic web services an
19
19
 
20
20
  ## Requirements
21
21
 
22
- * [Ruby on Rails >= 5.2.5](https://weblog.rubyonrails.org/releases/)
23
- * [GeoBlacklight >= 3.3](https://github.com/geoblacklight/geoblacklight)
22
+ * [Ruby on Rails >= 5.2, < 8.0](https://weblog.rubyonrails.org/releases/)
23
+ * [GeoBlacklight v4 or v3](https://github.com/geoblacklight/geoblacklight)
24
24
  * [ImageMagick](https://github.com/ImageMagick/ImageMagick)
25
25
 
26
26
  ### Suggested
@@ -33,10 +33,15 @@ This GeoBlacklight plugin captures remote images from geographic web services an
33
33
 
34
34
  ### Existing GeoBlacklight Instance
35
35
 
36
- Add the gem to your Gemfile.
36
+ GeoBlacklight v4 with Aardvark metadata / Add the gem to your Gemfile.
37
37
 
38
38
  ```ruby
39
- gem 'geoblacklight_sidecar_images'
39
+ gem "geoblacklight_sidecar_images", "~> 1.0"
40
+ ```
41
+
42
+ GeoBlacklight v3 with GBL v1.0 metadata / Add the gem to your Gemfile.
43
+ ```ruby
44
+ gem "geoblacklight_sidecar_images", "~> 0.9.1", "< 1.0"
40
45
  ```
41
46
 
42
47
  Run the generator.
@@ -73,7 +78,7 @@ config.active_storage.service = :local
73
78
  Create a new GeoBlacklight instance with the GBLSI code
74
79
 
75
80
  ```bash
76
- $ rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight_sidecar_images/master/template.rb
81
+ $ rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight_sidecar_images/develop/template.rb
77
82
 
78
83
  ```
79
84
 
@@ -215,7 +220,7 @@ document.sidecar.image.attached?
215
220
  document.sidecar.image.variable?
216
221
 
217
222
  # Example image_tag with resize
218
- <%= image_tag document.sidecar.image.variant(resize: "100x100"), {class: 'media-object'} %>
223
+ <%= image_tag document.sidecar.image.variant(resize_to_fit: [100, 100]), {class: 'media-object'} %>
219
224
 
220
225
  ```
221
226
 
@@ -236,7 +241,7 @@ Example for adding a thumbnail to the show page sidebar.
236
241
  <div class="card">
237
242
  <div class="card-header">Thumbnail</div>
238
243
  <div class="card-body">
239
- <%= image_tag @document.sidecar.image.variant(resize: "200"), {class: 'mr-3'} %>
244
+ <%= image_tag @document.sidecar.image.variant(resize_to_fit: [200, 200]), {class: 'mr-3'} %>
240
245
  </div>
241
246
  </div>
242
247
  <% end %>
@@ -261,21 +266,10 @@ bundle exec rake gblsci:sample_data:seed
261
266
  # Run harvest
262
267
  bundle exec rake gblsci:images:harvest_all
263
268
 
264
- # Tail log
269
+ # Tail image service log file
265
270
  tail -f log/image_service_development.log
266
271
 
267
272
  ```
268
273
 
269
274
  [See Localhost Results](http://localhost:3000/?per_page=50&q=&search_field=all_fields)
270
275
 
271
- ## TODOs
272
-
273
- * ~~0.0.1 - Initial gem~~
274
- * ~~0.1.0 - Prioritize local thumbnail solr field~~
275
- * ~~0.2.0 - Forgo attaching placeholder imagery~~
276
- * ~~0.3.0 - Add Statesman (state machine library)~~
277
- * ~~0.4.0 - Rails 5.2 branch / Switch to ActionStorage~~
278
- * ~~0.7.0 - Rails 5.2+ and 6+ / GeoBlacklight 2+ and 3+ support~~
279
- * ~~0.8.0 - GeoBlacklight Aardvark support~~
280
- * 0.7.0 to 0.9.0 - Feedback; Improve test coverage; Collect additional real-world issues
281
- * 1.0.0 - Final release
@@ -1,11 +1,35 @@
1
1
  // GBLSCI results
2
- .media {
3
- img,span {
4
- min-width: 100px;
5
- max-width: 100px;
6
- text-align: center;
2
+ #documents {
3
+ .index_title {
4
+ font-size: 1rem;
7
5
  }
8
- span.icon.square {
9
- font-size:3rem;
6
+
7
+ .status-icons {
8
+ display: inline-block;
9
+
10
+ span {
11
+ min-width: 0px;
12
+ }
10
13
  }
11
- }
14
+
15
+ .thumbnail {
16
+ height: 100px;
17
+ width: 100px;
18
+ margin-left:auto;
19
+ margin-right: auto;
20
+ img {
21
+ max-height: 160px;
22
+ width: inherit;
23
+ }
24
+ }
25
+
26
+ .icon .blacklight-icons {
27
+ height: 4.5rem;
28
+ width: 4.5rem;
29
+
30
+ svg {
31
+ height:95%;
32
+ width:95%;
33
+ }
34
+ }
35
+ }
@@ -17,6 +17,6 @@ module WmsRewriteConcern
17
17
  end
18
18
 
19
19
  def local?
20
- fetch(Settings.FIELDS.PROVENANCE, "").casecmp(Settings.INSTITUTION_LOCAL_NAME).zero?
20
+ fetch(Settings.FIELDS.PROVIDER, "").casecmp(Settings.INSTITUTION_LOCAL_NAME).zero?
21
21
  end
22
22
  end
@@ -19,7 +19,7 @@ module GeoblacklightSidecarImages
19
19
  "#{endpoint}/reflect?" \
20
20
  "&FORMAT=image%2Fpng" \
21
21
  "&TRANSPARENT=TRUE" \
22
- "&LAYERS=#{document["layer_id_s"]}" \
22
+ "&LAYERS=#{document["gbl_wxsIdentifier_s"]}" \
23
23
  "&WIDTH=#{size}" \
24
24
  "&HEIGHT=#{size}"
25
25
  end
@@ -128,7 +128,7 @@ module GeoblacklightSidecarImages
128
128
  return nil unless uri.scheme.include?("http")
129
129
 
130
130
  conn = Faraday.new(url: uri.normalize.to_s) do |b|
131
- b.use FaradayMiddleware::FollowRedirects
131
+ b.use Geoblacklight::FaradayMiddleware::FollowRedirects
132
132
  b.adapter :net_http
133
133
  end
134
134
 
@@ -17,23 +17,23 @@ Gem::Specification.new do |s|
17
17
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency "faraday", ">= 1.0"
21
- s.add_dependency "geoblacklight", "~> 3.3"
20
+ s.add_dependency "faraday", ">= 2.0"
21
+ s.add_dependency "geoblacklight", "~> 4.0"
22
22
  s.add_dependency "image_processing", "~> 1.6"
23
23
  s.add_dependency "mimemagic", "~> 0.3"
24
24
  s.add_dependency "mini_magick", "~> 4.9.4"
25
- s.add_dependency "rails", ">= 5.2", "< 7.1"
25
+ s.add_dependency "rails", ">= 5.2", "< 8.0"
26
26
  s.add_dependency "statesman", ">= 3.4"
27
27
 
28
28
  s.add_development_dependency "byebug"
29
29
  s.add_development_dependency "capybara"
30
30
  s.add_development_dependency "webdrivers"
31
- s.add_development_dependency "database_cleaner", "~> 1.3"
32
- s.add_development_dependency "engine_cart", "~> 2.2"
33
- s.add_development_dependency "rspec-rails", "~> 3.0"
31
+ s.add_development_dependency "database_cleaner", "~> 2.0"
32
+ s.add_development_dependency "engine_cart", "~> 2.0"
33
+ s.add_development_dependency "rspec-rails", "~> 6.0"
34
34
  s.add_development_dependency "selenium-webdriver"
35
35
  s.add_development_dependency "simplecov", "~> 0.22"
36
36
  s.add_development_dependency "solr_wrapper", "~> 4.0"
37
37
  s.add_development_dependency "sprockets", "< 4"
38
- s.add_development_dependency "standard", "~> 1.24"
38
+ s.add_development_dependency "standard", "~> 1.0"
39
39
  end
@@ -12,7 +12,7 @@ module GeoblacklightSidecarImages
12
12
  DESCRIPTION
13
13
 
14
14
  def set_active_storage_processor
15
- app_config = <<-"APP"
15
+ app_config = <<-APP
16
16
 
17
17
  config.active_storage.variant_processor = :mini_magick
18
18
  APP
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators"
4
+
5
+ module GeoblacklightSidecarImages
6
+ class HelpersGenerator < Rails::Generators::Base
7
+ source_root File.expand_path("templates", __dir__)
8
+
9
+ desc <<-DESCRIPTION
10
+ This generator makes the following changes to your application:
11
+ 1. Creates an app/helpers/blacklight directory
12
+ DESCRIPTION
13
+
14
+ def create_views
15
+ copy_file(
16
+ "helpers/blacklight/layout_helper_behavior.rb",
17
+ "app/helpers/blacklight/layout_helper_behavior.rb"
18
+ )
19
+ end
20
+ end
21
+ end
@@ -17,7 +17,9 @@ GBLSI_THUMBNAIL_FIELD: 'thumbnail_path_ss'"
17
17
  end
18
18
 
19
19
  def generate_gblsci_assets
20
- copy_file "gblsci.scss", "app/assets/stylesheets/gblsci.scss"
20
+ inject_into_file "app/assets/stylesheets/application.scss", after: "@import 'geoblacklight';\n" do
21
+ "@import 'geoblacklight_sidecar_images/gblsci';"
22
+ end
21
23
  end
22
24
 
23
25
  def generate_gblsci_example_docs
@@ -36,6 +38,10 @@ GBLSI_THUMBNAIL_FIELD: 'thumbnail_path_ss'"
36
38
  generate "geoblacklight_sidecar_images:views"
37
39
  end
38
40
 
41
+ def generate_gblsci_helpers
42
+ generate "geoblacklight_sidecar_images:helpers"
43
+ end
44
+
39
45
  def generate_action_storage
40
46
  rake "active_storage:install"
41
47
  end
@@ -12,7 +12,7 @@ module GeoblacklightSidecarImages
12
12
  DESCRIPTION
13
13
 
14
14
  def config_development_jobs_queue_adapter
15
- job_config = <<-"JOBS"
15
+ job_config = <<-JOBS
16
16
  config.active_job.queue_adapter = :inline
17
17
  JOBS
18
18
 
@@ -22,7 +22,7 @@ module GeoblacklightSidecarImages
22
22
  end
23
23
 
24
24
  def include_sidecar_solrdocument
25
- sidecar = <<-"SIDECAR"
25
+ sidecar = <<-SIDECAR
26
26
  def sidecar
27
27
  # Find or create, and set version
28
28
  sidecar = SolrDocumentSidecar.where(
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Methods added to this helper will be available to all templates in the hosting
4
+ # application
5
+ module Blacklight
6
+ # A module for useful methods used in layout configuration
7
+ module LayoutHelperBehavior
8
+ ##
9
+ # Classes added to a document's show content div
10
+ # @return [String]
11
+ def show_content_classes
12
+ "#{main_content_classes} show-document"
13
+ end
14
+
15
+ ##
16
+ # Attributes to add to the <html> tag (e.g. lang and dir)
17
+ # @return [Hash]
18
+ def html_tag_attributes
19
+ {lang: I18n.locale}
20
+ end
21
+
22
+ ##
23
+ # Classes added to a document's sidebar div
24
+ # @return [String]
25
+ def show_sidebar_classes
26
+ sidebar_classes
27
+ end
28
+
29
+ ##
30
+ # Classes used for sizing the main content of a Blacklight page
31
+ # @return [String]
32
+ def main_content_classes
33
+ "col-lg-9"
34
+ end
35
+
36
+ ##
37
+ # Classes used for sizing the sidebar content of a Blacklight page
38
+ # @return [String]
39
+ def sidebar_classes
40
+ "page-sidebar col-lg-3"
41
+ end
42
+
43
+ ##
44
+ # Class used for specifying main layout container classes. Can be
45
+ # overwritten to return 'container-fluid' for Bootstrap full-width layout
46
+ # @return [String]
47
+ def container_classes
48
+ "container-fluid"
49
+ end
50
+
51
+ ##
52
+ # Render "document actions" area for navigation header
53
+ # (normally renders "Saved Searches", "History", "Bookmarks")
54
+ # These things are added by add_nav_action
55
+ #
56
+ # @param [Hash] options
57
+ # @return [String]
58
+ def render_nav_actions(options = {}, &)
59
+ render_filtered_partials(blacklight_config.navbar.partials, options, &)
60
+ end
61
+
62
+ ##
63
+ # Open Search discovery tag for HTML <head> links
64
+ # @return [String]
65
+ def opensearch_description_tag title, href
66
+ tag :link, href: href, title: title, type: "application/opensearchdescription+xml", rel: "search"
67
+ end
68
+
69
+ ##
70
+ # Get the page's HTML title
71
+ #
72
+ # @return [String]
73
+ def render_page_title
74
+ (content_for(:page_title) if content_for?(:page_title)) || @page_title || application_name
75
+ end
76
+
77
+ ##
78
+ # Create <link rel="alternate"> links from a documents dynamically
79
+ # provided export formats.
80
+ #
81
+ # Returns empty string if no links available.
82
+ #
83
+ # @param [SolrDocument] document
84
+ # @param [Hash] options
85
+ # @option options [Boolean] :unique ensures only one link is output for every
86
+ # content type, e.g. as required by atom
87
+ # @option options [Array<String>] :exclude array of format shortnames to not include in the output
88
+ # @return [String]
89
+ def render_link_rel_alternates(document = @document, options = {})
90
+ return if document.nil?
91
+
92
+ document_presenter(document).link_rel_alternates(options)
93
+ end
94
+
95
+ ##
96
+ # Render classes for the <body> element
97
+ # @return [String]
98
+ def render_body_class
99
+ extra_body_classes.join " "
100
+ end
101
+
102
+ ##
103
+ # List of classes to be applied to the <body> element
104
+ # @see render_body_class
105
+ # @return [Array<String>]
106
+ def extra_body_classes
107
+ @extra_body_classes ||= ["blacklight-#{controller.controller_name}", "blacklight-#{[controller.controller_name, controller.action_name].join("-")}"]
108
+ end
109
+ end
110
+ end
@@ -1,31 +1,32 @@
1
1
  <% # header bar for doc items in index view -%>
2
- <%= content_tag :div, class: 'documentHeader row', data: { layer_id: document.id, geom: document.geometry.geojson } do %>
3
- <div class='status-icons'>
4
- <%= render partial: 'header_icons', locals: { document: document } %>
5
- </div>
6
- <h3 class="index_title col-sm-9s cosl-lg-10 text-span">
7
- <% counter = document_counter_with_offset(document_counter) %>
8
- <span class="document-counter">
9
- <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
10
- </span>
11
- <%= link_to_document document, counter: counter, title: document[blacklight_config.index.title_field] %>
12
- </h3>
13
-
14
- <div class='col-md-12 more-info-area'>
15
- <div class='media'>
16
- <% if document.sidecar.image.attached? %>
17
- <% if document.sidecar.image.variable? %>
18
- <%= image_tag document.sidecar.image.variant(resize: "200"), {class: 'mr-3'} %>
2
+ <%= content_tag :div, class: 'documentHeader row mb-4', data: { layer_id: document.id, geom: document.geometry.geojson } do %>
3
+ <div class='col-md-12'>
4
+ <div class='row'>
5
+ <div class='col-2 thumbnail'>
6
+ <% if document.sidecar.image.attached? %>
7
+ <% if document.sidecar.image.variable? %>
8
+ <%= image_tag document.sidecar.image.variant(resize_to_fit: [200, 200]) %>
9
+ <% else %>
10
+ <%= image_tag document.sidecar.image %>
11
+ <% end %>
19
12
  <% else %>
20
- <%= image_tag document.sidecar.image, {class: 'mr-3'} %>
13
+ <span class="icon square" title="<%=document[Settings.FIELDS.RESOURCE_CLASS]%>">
14
+ <%= geoblacklight_icon(document[Settings.FIELDS.RESOURCE_CLASS].first) %>
15
+ </span>
21
16
  <% end %>
22
- <% else %>
23
- <span class="icon square mr-3" title="<%=document[Settings.FIELDS.GEOM_TYPE]%>">
24
- <%= geoblacklight_icon(document[Settings.FIELDS.GEOM_TYPE]) %>
25
- </span>
26
- <% end %>
27
- <div class='media-body'>
17
+ </div>
18
+ <div class='col-9'>
19
+ <h3 class="index_title text-span">
20
+ <% counter = document_counter_with_offset(document_counter) %>
21
+ <span class="document-counter">
22
+ <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
23
+ </span>
24
+ <%= link_to_document document, counter: counter, itemprop: "name" %>
25
+ </h3>
28
26
  <small>
27
+ <div class='status-icons'>
28
+ <%= render partial: 'header_icons', locals: { document: document } %>
29
+ </div>
29
30
  <%= geoblacklight_present(:index_fields_display, document) %>
30
31
  </small>
31
32
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightSidecarImages
4
- VERSION = "0.9.1"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -36,7 +36,7 @@ namespace :gblsci do
36
36
  results.docs.each do |document|
37
37
  sleep(1)
38
38
  begin
39
- GeoblacklightSidecarImages::StoreImageJob.perform_later(document["layer_slug_s"])
39
+ GeoblacklightSidecarImages::StoreImageJob.perform_later(document["id"])
40
40
  rescue Blacklight::Exceptions::RecordNotFound
41
41
  next
42
42
  end