Skip to content

Commit

Permalink
Merge pull request #3160 from projectblacklight/default-admin-component
Browse files Browse the repository at this point in the history
Add a default document component for the admin table + blacklight 7.
  • Loading branch information
jcoyne authored Sep 27, 2024
2 parents e023cf8 + 02fb218 commit f6a5d27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/spotlight/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class CatalogController < ::CatalogController
partials: [:index_compact],
document_actions: [])
end
blacklight_config.view.admin_table.document_component ||= Spotlight::DocumentAdminTableComponent

if Blacklight::VERSION > '8'
blacklight_config.track_search_session.storage = false
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/spotlight/catalog/_document_admin_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</thead>
<% if Blacklight.version < '8.0' %>
<%= render view_config.document_component.with_collection(documents) %>
<%= render (view_config.document_component || Spotlight::DocumentAdminTableComponent).with_collection(documents) %>
<% else %>
<% document_presenters = documents.map { |doc| document_presenter(doc) } -%>
<%= render view_config.document_component.with_collection(document_presenters) %>
Expand Down

0 comments on commit f6a5d27

Please sign in to comment.