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

#collection_actionsString, Symbol

Returns:

  • (String, Symbol)


# File 'lib/blacklight/configuration/view_config.rb', line 87

#constraints_componentClass

Returns component class used to render the constraints.

Returns:

  • (Class)

    component class used to render the constraints



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

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



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

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

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

Returns ‘tools’ to render for each document.

Returns:



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

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



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

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

#document_embed_componentClass

Returns component class used to render a document embed.

Returns:

  • (Class)

    component class used to render a document embed



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

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

#document_metadata_componentClass

Returns component class used to render the document metadata.

Returns:

  • (Class)

    component class used to render the document metadata



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

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

#document_presenter_classClass

Returns document presenter class used by helpers and views.

Returns:

  • (Class)

    document presenter class used by helpers and views



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

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

#document_thumbnail_componentClass

Returns component class used to render a document thumbnail.

Returns:

  • (Class)

    component class used to render a document thumbnail



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

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

#document_title_componentClass

Returns component class used to render a document title.

Returns:

  • (Class)

    component class used to render a document title



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

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

#facet_group_componentClass

Returns component class used to render a facet group.

Returns:

  • (Class)

    component class used to render a facet group



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

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

#groupfalse, ...

Returns what field, if any, to use to render grouped results.

Returns:

  • (false, String, Symbol)

    what field, if any, to use to render grouped results



# File 'lib/blacklight/configuration/view_config.rb', line 87

#iconString, ...

Returns icon file to use in the view picker.

Returns:



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

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

#respond_toOpenStructWithHashAccess{Symbol => OpenStruct}

Returns additional response formats for search results; see Blacklight::Catalog#additional_response_formats for information about the OpenStruct data.

Returns:

  • (OpenStructWithHashAccess{Symbol => OpenStruct})

    additional response formats for search results; see Blacklight::Catalog#additional_response_formats for information about the OpenStruct data



# File 'lib/blacklight/configuration/view_config.rb', line 87

#routeHash

Returns Default route parameters for ‘show’ requests. Set this to a hash with additional arguments to merge into the route, or set ‘controller: :current` to route to the current controller.

Returns:

  • (Hash)

    Default route parameters for ‘show’ requests. Set this to a hash with additional arguments to merge into the route, or set ‘controller: :current` to route to the current controller.



# File 'lib/blacklight/configuration/view_config.rb', line 80

#search_bar_componentClass

Returns component class used to render the search bar.

Returns:

  • (Class)

    component class used to render the search bar



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

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



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

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

#templateString

Returns partial to render around the documents.

Returns:

  • (String)

    partial to render around the documents



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

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



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

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

Instance Method Details

#display_labelObject



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

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

#embed_componentObject



61
# File 'lib/blacklight/configuration/view_config.rb', line 61

def embed_component(*) = document_embed_component(*)

#embed_component=(value) ⇒ Object



75
76
77
# File 'lib/blacklight/configuration/view_config.rb', line 75

def embed_component=(value)
  self.document_embed_component = value
end

#metadata_componentObject



59
# File 'lib/blacklight/configuration/view_config.rb', line 59

def (*) = (*)

#metadata_component=(value) ⇒ Object



67
68
69
# File 'lib/blacklight/configuration/view_config.rb', line 67

def (value)
  self. = value
end

#thumbnail_componentObject



60
# File 'lib/blacklight/configuration/view_config.rb', line 60

def thumbnail_component(*) = document_thumbnail_component(*)

#thumbnail_component=(value) ⇒ Object



71
72
73
# File 'lib/blacklight/configuration/view_config.rb', line 71

def thumbnail_component=(value)
  self.document_thumbnail_component = value
end

#title_componentObject

Provide backwards compatibility with the configuration keys without the document_ prefix



58
# File 'lib/blacklight/configuration/view_config.rb', line 58

def title_component(*) = document_title_component(*)

#title_component=(value) ⇒ Object



63
64
65
# File 'lib/blacklight/configuration/view_config.rb', line 63

def title_component=(value)
  self.document_title_component = value
end