Sha256: 22ee79ae308edb83c4162419b576cb479d299497ea9cb68125fc8c558a0e3d2f

Contents?: true

Size: 747 Bytes

Versions: 14

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

module Arclight
  # Display a single document in the collection
  class DocumentCollectionContextComponent < Arclight::SearchResultComponent
    # @param [SolrDocument] document
    def initialize(document: nil, blacklight_config: nil, **kwargs)
      super(document: document, **kwargs)
      @blacklight_config = blacklight_config
    end

    attr_reader :blacklight_config

    def classes
      (super - ['row'] + ['al-collection-context']).flatten
    end

    private

    def online_status
      render online_status_component.new(document: @document)
    end

    def online_status_component
      blacklight_config.show.online_status_component || Arclight::OnlineStatusIndicatorComponent
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
arclight-1.4.0 app/components/arclight/document_collection_context_component.rb
arclight-1.3.0 app/components/arclight/document_collection_context_component.rb
arclight-1.2.0 app/components/arclight/document_collection_context_component.rb
arclight-1.1.3 app/components/arclight/document_collection_context_component.rb
arclight-1.1.2 app/components/arclight/document_collection_context_component.rb
arclight-1.1.1 app/components/arclight/document_collection_context_component.rb
arclight-1.1.0 app/components/arclight/document_collection_context_component.rb
arclight-1.0.1 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0.beta6 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0.beta4 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0.beta3 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0.beta2 app/components/arclight/document_collection_context_component.rb
arclight-1.0.0.beta1 app/components/arclight/document_collection_context_component.rb