Sha256: 6ccbff34384cdefbc724f0c826ae1b27a191d619620b305f5048b525a03e49c2

Contents?: true

Size: 640 Bytes

Versions: 5

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

module Arclight
  # Render a collection document for a
  # grouped search result view
  class GroupComponent < Blacklight::Document::GroupComponent
    def compact?
      helpers.document_index_view_type.to_s == 'compact'
    end

    def document
      @document ||= @group.docs.first.collection
    end

    def presenter
      @presenter ||= Arclight::ShowPresenter.new(document, helpers).with_field_group('group_header_field')
    end

    def search_within_collection_url
      search_catalog_path(helpers.search_without_group.deep_merge(f: { collection: [document.collection_name] }))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arclight-1.4.0 app/components/arclight/group_component.rb
arclight-1.3.0 app/components/arclight/group_component.rb
arclight-1.2.0 app/components/arclight/group_component.rb
arclight-1.1.3 app/components/arclight/group_component.rb
arclight-1.1.2 app/components/arclight/group_component.rb