Class: Blacklight::Configuration::ViewConfig

Inherits:
OpenStructWithHashAccess show all
Defined in:
lib/blacklight/configuration/view_config.rb

Direct Known Subclasses

Index, Show

Defined Under Namespace

Classes: Index, Show

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OpenStructWithHashAccess

#deep_dup, #merge, #merge!, #reverse_merge, #select, #sort_by, #sort_by!, #to_h, #try

Instance Attribute Details

#display_type_fieldString, Symbol

Returns solr field to use to render format-specific partials.

Returns:

  • (String, Symbol)

    solr field to use to render format-specific partials



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#document_actionsNestedOpenStructWithHashAccess{Symbol => Blacklight::Configuration::ToolConfig}

Returns 'tools' to render for each document.

Returns:



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#document_componentClass

Returns component class used to render a document; defaults to Blacklight::DocumentComponent.

Returns:

  • (Class)

    component class used to render a document; defaults to Blacklight::DocumentComponent



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#document_presenter_classClass

Returns document presenter class used by helpers and views.

Returns:

  • (Class)

    document presenter class used by helpers and views



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#iconString, Symbol

Returns icon file to use in the view picker.

Returns:

  • (String, Symbol)

    icon file to use in the view picker



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#partialsArray<String>

Returns partials to render for each document(see #render_document_partials).

Returns:

  • (Array<String>)

    partials to render for each document(see #render_document_partials)



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#templateString

Returns partial to render around the documents.

Returns:

  • (String)

    partial to render around the documents



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#title_fieldString, Symbol

Returns solr field to use to render a document title.

Returns:

  • (String, Symbol)

    solr field to use to render a document title



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

Instance Method Details

#display_label(deprecated_key = nil, **options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/blacklight/configuration/view_config.rb', line 24

def display_label(deprecated_key = nil, **options)
  Deprecation.warn(Blacklight::Configuration::ViewConfig, 'Passing the key argument to ViewConfig#display_label is deprecated') if deprecated_key.present?

  I18n.t(
    :"blacklight.search.view_title.#{deprecated_key || key}",
    default: [
      :"blacklight.search.view.#{deprecated_key || key}",
      label,
      title,
      (deprecated_key || key).to_s.humanize
    ],
    **options
  )
end

#search_bar_presenter_classObject



20
21
22
# File 'lib/blacklight/configuration/view_config.rb', line 20

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end