Class: Blacklight::Configuration::ViewConfig
- Inherits:
-
OpenStructWithHashAccess
- Object
- OpenStruct
- OpenStructWithHashAccess
- Blacklight::Configuration::ViewConfig
- Defined in:
- lib/blacklight/configuration/view_config.rb
Defined Under Namespace
Instance Attribute Summary collapse
- #collection_actions ⇒ String, Symbol
-
#constraints_component ⇒ Class
Component class used to render the constraints.
-
#display_type_field ⇒ String, Symbol
Solr field to use to render format-specific partials.
-
#document_actions ⇒ NestedOpenStructWithHashAccess{Symbol => Blacklight::Configuration::ToolConfig}
‘tools’ to render for each document.
-
#document_component ⇒ Class
Component class used to render a document; defaults to Blacklight::DocumentComponent.
-
#document_embed_component ⇒ Class
Component class used to render a document embed.
-
#document_metadata_component ⇒ Class
Component class used to render the document metadata.
-
#document_presenter_class ⇒ Class
Document presenter class used by helpers and views.
-
#document_thumbnail_component ⇒ Class
Component class used to render a document thumbnail.
-
#document_title_component ⇒ Class
Component class used to render a document title.
-
#facet_group_component ⇒ Class
Component class used to render a facet group.
-
#group ⇒ false, ...
What field, if any, to use to render grouped results.
-
#icon ⇒ String, ...
Icon file to use in the view picker.
-
#respond_to ⇒ OpenStructWithHashAccess{Symbol => OpenStruct}
Additional response formats for search results; see Blacklight::Catalog#additional_response_formats for information about the OpenStruct data.
-
#route ⇒ Hash
Default route parameters for ‘show’ requests.
-
#search_bar_component ⇒ Class
Component class used to render the search bar.
-
#search_header_component ⇒ Class
Component class used to render the header above the documents.
-
#template ⇒ String
Partial to render around the documents.
-
#title_field ⇒ String, Symbol
Solr field to use to render a document title.
Instance Method Summary collapse
- #display_label ⇒ Object
- #embed_component ⇒ Object
- #embed_component=(value) ⇒ Object
- #metadata_component ⇒ Object
- #metadata_component=(value) ⇒ Object
- #thumbnail_component ⇒ Object
- #thumbnail_component=(value) ⇒ Object
-
#title_component ⇒ Object
Provide backwards compatibility with the configuration keys without the document_ prefix.
- #title_component=(value) ⇒ Object
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_actions ⇒ String, Symbol
|
|
# File 'lib/blacklight/configuration/view_config.rb', line 87
|
#constraints_component ⇒ Class
Returns 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_field ⇒ String, Symbol
Returns 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_actions ⇒ NestedOpenStructWithHashAccess{Symbol => Blacklight::Configuration::ToolConfig}
Returns ‘tools’ to render for each document.
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_component ⇒ Class
Returns 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_component ⇒ Class
Returns 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_component ⇒ Class
Returns 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_class ⇒ Class
Returns 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_component ⇒ Class
Returns 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_component ⇒ Class
Returns 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_component ⇒ Class
Returns 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 |
#group ⇒ false, ...
Returns what field, if any, to use to render grouped results.
|
|
# File 'lib/blacklight/configuration/view_config.rb', line 87
|
#icon ⇒ String, ...
Returns icon file to use in the view picker.
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_to ⇒ OpenStructWithHashAccess{Symbol => OpenStruct}
Returns 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
|
#route ⇒ Hash
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.
|
|
# File 'lib/blacklight/configuration/view_config.rb', line 80
|
#search_bar_component ⇒ Class
Returns 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_component ⇒ Class
Returns 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 |
#template ⇒ String
Returns 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_field ⇒ String, Symbol
Returns 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_label ⇒ Object
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_component ⇒ Object
61 |
# File 'lib/blacklight/configuration/view_config.rb', line 61 def (*) = (*) |
#embed_component=(value) ⇒ Object
75 76 77 |
# File 'lib/blacklight/configuration/view_config.rb', line 75 def (value) self. = value end |
#metadata_component ⇒ Object
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_component ⇒ Object
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_component ⇒ Object
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 |