blacklight-spotlight 4.3.2 → 4.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
 
23
23
  <div class="page-links">
24
- <%= helpers.view_link presenter.document, helpers.link_to_document(presenter.document) %> &middot;
24
+ <%= helpers.view_link presenter.document, helpers.search_state.url_for_document(presenter.document) %> &middot;
25
25
  <%= helpers.exhibit_edit_link presenter.document, [:edit, helpers.current_exhibit, presenter.document] %>
26
26
  </div>
27
27
  </td>
@@ -1,7 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Render an document suitable for embedding on a feature page.
4
3
  module Spotlight
4
+ # Render an document suitable for embedding on a feature page.
5
5
  class SolrDocumentLegacyEmbedComponent < Blacklight::DocumentComponent
6
+ attr_reader :block_context
7
+
8
+ def initialize(*args, block: nil, **kwargs)
9
+ super
10
+
11
+ @block_context = block
12
+ end
13
+
14
+ def before_render
15
+ set_slot(:embed, nil, block_context: block_context) unless embed
16
+
17
+ super
18
+ end
6
19
  end
7
20
  end
@@ -4,6 +4,11 @@ module Spotlight
4
4
  ##
5
5
  # Helpers that are injected into the main application (because they used in layouts)
6
6
  module MainAppHelpers
7
+ if Blacklight.version < '8'
8
+ include Blacklight::BlacklightHelperBehavior
9
+ else
10
+ include Blacklight::DocumentHelperBehavior
11
+ end
7
12
  include Spotlight::NavbarHelper
8
13
  include Spotlight::MastheadHelper
9
14
 
@@ -24,6 +29,11 @@ module Spotlight
24
29
  super
25
30
  end
26
31
 
32
+ # Expecting to upstream this override in https://github.com/projectblacklight/blacklight/pull/3343/files
33
+ def document_presenter(document, view_config: nil, **kwargs)
34
+ (view_config&.document_presenter_class || document_presenter_class(document)).new(document, self, view_config: view_config, **kwargs)
35
+ end
36
+
27
37
  def document_presenter_class(_document)
28
38
  if action_name == 'index'
29
39
  super
@@ -1,6 +1,6 @@
1
1
  <div class="box" data-id="<%= document.id %>">
2
2
  <% view_config = blacklight_config.view_config(:embed) %>
3
- <%= render (view_config.document_component || Spotlight::SolrDocumentLegacyEmbedComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(document), counter: nil, block: local_assigns[:block]) do |component| %>
3
+ <%= render (view_config.document_component || Spotlight::SolrDocumentLegacyEmbedComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(document, view_config: view_config), counter: nil, block: local_assigns[:block]) do |component| %>
4
4
  <% component.with_partial do %>
5
5
  <%= render_document_partials document, view_config.partials, component: component, document_counter: nil, view_config: view_config, block: local_assigns[:block], **(view_config.locals) %>
6
6
  <% end if view_config&.partials&.any? %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '4.3.2'
4
+ VERSION = '4.3.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.2
4
+ version: 4.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-10-25 00:00:00.000000000 Z
14
+ date: 2024-11-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: '7.19'
70
+ version: '7.40'
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: '9'
@@ -77,7 +77,7 @@ dependencies:
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: '7.19'
80
+ version: '7.40'
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '9'
@@ -1586,7 +1586,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1586
1586
  - !ruby/object:Gem::Version
1587
1587
  version: '0'
1588
1588
  requirements: []
1589
- rubygems_version: 3.5.9
1589
+ rubygems_version: 3.4.19
1590
1590
  signing_key:
1591
1591
  specification_version: 4
1592
1592
  summary: Enable librarians, curators, and others who are responsible for digital collections