Skip to content

Commit

Permalink
Merge pull request #2874 from projectblacklight/backport-2869
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne authored Nov 9, 2022
2 parents 7e8fa15 + e7a7fe5 commit 0fcf47e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions app/helpers/blacklight/component_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,26 @@ def render_nav_actions(options = {}, &block)
# (normally renders next to title in the list view)
#
# @param [SolrDocument] document
# @param [Hash] options
# @option options [String] :wrapping_class
# @param [String] wrapping_class ("index-document-functions")
# @param [Class] component (Blacklight::Document::ActionsComponent)
# @return [String]
def render_index_doc_actions(document, options = {})
actions = filter_partials(blacklight_config.view_config(document_index_view_type).document_actions, { document: document }.merge(options)).map { |_k, v| v }
wrapping_class = options.delete(:wrapping_class) || "index-document-functions"
def render_index_doc_actions(document, wrapping_class: "index-document-functions", component: Blacklight::Document::ActionsComponent)
actions = filter_partials(blacklight_config.view_config(document_index_view_type).document_actions, { document: document }).map { |_k, v| v }

render(Blacklight::Document::ActionsComponent.new(document: document, actions: actions, options: options, classes: wrapping_class))
render(component.new(document: document, actions: actions, classes: wrapping_class))
end

##
# Render "collection actions" area for search results view
# (normally renders next to pagination at the top of the result set)
#
# @param [Hash] options
# @option options [String] :wrapping_class
# @param [String] wrapping_class ("search-widgets")
# @param [Class] component (Blacklight::Document::ActionsComponent)
# @return [String]
def render_results_collection_tools(options = {})
actions = filter_partials(blacklight_config.view_config(document_index_view_type).collection_actions, options).map { |_k, v| v }
wrapping_class = options.delete(:wrapping_class) || "search-widgets"
def render_results_collection_tools(wrapping_class: "search-widgets", component: Blacklight::Document::ActionsComponent)
actions = filter_partials(blacklight_config.view_config(document_index_view_type).collection_actions, {}).map { |_k, v| v }

render(Blacklight::Document::ActionsComponent.new(actions: actions, options: options, classes: wrapping_class))
render(component.new(actions: actions, classes: wrapping_class))
end

##
Expand Down

0 comments on commit 0fcf47e

Please sign in to comment.