Sha256: 8e34af29c234f555eb3435c70125d6ce1aa552e150c65309243afeb82eb8397f

Contents?: true

Size: 788 Bytes

Versions: 12

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Document
    # Render the sidebar on the show view
    class SidebarComponent < Blacklight::Component
      # @param [Blacklight::DocumentPresenter] presenter
      def initialize(presenter:)
        @presenter = presenter
        @document = presenter.document
      end

      attr_reader :document

      delegate :blacklight_config, to: :helpers

      private

      def render_show_tools
        blacklight_config.view_config(:show).show_tools_component&.tap do |show_tools_component_class|
          return render show_tools_component_class.new(document: document)
        end

        render 'show_tools', document: document, silence_deprecation: helpers.partial_from_blacklight?('show_tools')
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/document/sidebar_component.rb
blacklight-8.6.0 app/components/blacklight/document/sidebar_component.rb
blacklight-8.5.1 app/components/blacklight/document/sidebar_component.rb
blacklight-8.5.0 app/components/blacklight/document/sidebar_component.rb
blacklight-8.4.0 app/components/blacklight/document/sidebar_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/document/sidebar_component.rb
blacklight-8.3.0 app/components/blacklight/document/sidebar_component.rb
blacklight-8.2.2 app/components/blacklight/document/sidebar_component.rb
blacklight-8.2.1 app/components/blacklight/document/sidebar_component.rb
blacklight-8.2.0 app/components/blacklight/document/sidebar_component.rb
blacklight-8.1.0 app/components/blacklight/document/sidebar_component.rb
blacklight-8.0.1 app/components/blacklight/document/sidebar_component.rb