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

Instance Attribute Details

#constraints_componentClass

Returns component class used to render the constraints.

Returns:

  • (Class)

    component class used to render the constraints



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#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



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

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

Returns ‘tools’ to render for each document.

Returns:



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

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



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

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



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#facet_group_componentClass

Returns component class used to render a facet group.

Returns:

  • (Class)

    component class used to render a facet group



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#iconString, ...

Returns icon file to use in the view picker.

Returns:



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

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)



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#render_partials_in_component=(value) ⇒ Boolean (writeonly)

Returns whether to render partials in the component. This is false by default in Blacklight 7, but true in Blacklight 8.

Returns:

  • (Boolean)

    whether to render partials in the component. This is false by default in Blacklight 7, but true in Blacklight 8.



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

#search_bar_componentClass

Returns component class used to render the search bar.

Returns:

  • (Class)

    component class used to render the search bar



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

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



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

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



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end

Instance Method Details

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



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/blacklight/configuration/view_config.rb', line 32

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

#render_partials_in_component?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/blacklight/configuration/view_config.rb', line 47

def render_partials_in_component?
  render_partials_in_component
end

#search_bar_presenter_classObject



28
29
30
# File 'lib/blacklight/configuration/view_config.rb', line 28

def search_bar_presenter_class
  super || Blacklight::SearchBarPresenter
end