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, #deep_transform_values, #merge, #merge!, #reverse_merge, #select, #sort_by, #sort_by!, #to_h, #try

Instance Attribute Details

#constraints_componentClass

Returns component class used to render the constraints.

Returns:

  • (Class)

    component class used to render the constraints



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

def display_label(**options)
  I18n.t(
    :"blacklight.search.view_title.#{key}",
    default: [
      :"blacklight.search.view.#{key}",
      label,
      title,
      key.to_s.humanize
    ],
    **options
  )
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



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

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

Returns ‘tools’ to render for each document.

Returns:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

def display_label(**options)
  I18n.t(
    :"blacklight.search.view_title.#{key}",
    default: [
      :"blacklight.search.view.#{key}",
      label,
      title,
      key.to_s.humanize
    ],
    **options
  )
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



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#document_presenter_classClass

Returns document presenter class used by helpers and views.

Returns:

  • (Class)

    document presenter class used by helpers and views



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#facet_group_componentClass

Returns component class used to render a facet group.

Returns:

  • (Class)

    component class used to render a facet group



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#iconString, ...

Returns icon file to use in the view picker.

Returns:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

def display_label(**options)
  I18n.t(
    :"blacklight.search.view_title.#{key}",
    default: [
      :"blacklight.search.view.#{key}",
      label,
      title,
      key.to_s.humanize
    ],
    **options
  )
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)



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#search_bar_componentClass

Returns component class used to render the search bar.

Returns:

  • (Class)

    component class used to render the search bar



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#search_header_componentClass

Returns component class used to render the header above the documents.

Returns:

  • (Class)

    component class used to render the header above the documents



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

#templateString

Returns partial to render around the documents.

Returns:

  • (String)

    partial to render around the documents



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

def display_label(**options)
  I18n.t(
    :"blacklight.search.view_title.#{key}",
    default: [
      :"blacklight.search.view.#{key}",
      label,
      title,
      key.to_s.humanize
    ],
    **options
  )
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



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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

Instance Method Details

#display_label(**options) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blacklight/configuration/view_config.rb', line 29

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