Class: Arclight::DocumentComponent
- Inherits:
-
Blacklight::DocumentComponent
- Object
- Blacklight::DocumentComponent
- Arclight::DocumentComponent
- Defined in:
- app/components/arclight/document_component.rb
Overview
Render a single document
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #access ⇒ Object
- #blacklight_config ⇒ Object
-
#bookmark_config ⇒ Blacklight::Configuration::ToolConfig
The configuration for the bookmark.
- #breadcrumb_component ⇒ Object
- #component_metadata_partials ⇒ Object
- #metadata_partials ⇒ Object
- #online_content? ⇒ Boolean
- #online_filter ⇒ Object
- #toggle_sidebar ⇒ Object
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
6 7 8 |
# File 'app/components/arclight/document_component.rb', line 6 def document @document end |
Instance Method Details
#access ⇒ Object
37 38 39 |
# File 'app/components/arclight/document_component.rb', line 37 def access render (blacklight_config.show.access_component || Arclight::AccessComponent).new(presenter: presenter) end |
#blacklight_config ⇒ Object
12 13 14 |
# File 'app/components/arclight/document_component.rb', line 12 def blacklight_config presenter.configuration end |
#bookmark_config ⇒ Blacklight::Configuration::ToolConfig
Returns the configuration for the bookmark.
17 18 19 |
# File 'app/components/arclight/document_component.rb', line 17 def bookmark_config blacklight_config.index.document_actions.arclight_bookmark_control end |
#breadcrumb_component ⇒ Object
21 22 23 |
# File 'app/components/arclight/document_component.rb', line 21 def blacklight_config.show. || Arclight::BreadcrumbsHierarchyComponent end |
#component_metadata_partials ⇒ Object
29 30 31 |
# File 'app/components/arclight/document_component.rb', line 29 def blacklight_config.show. || [] end |
#metadata_partials ⇒ Object
25 26 27 |
# File 'app/components/arclight/document_component.rb', line 25 def blacklight_config.show. || [] end |
#online_content? ⇒ Boolean
8 9 10 |
# File 'app/components/arclight/document_component.rb', line 8 def online_content? document.online_content? && (document.collection? || document.children?) end |
#online_filter ⇒ Object
33 34 35 |
# File 'app/components/arclight/document_component.rb', line 33 def online_filter render Arclight::OnlineContentFilterComponent.new(document: document) end |
#toggle_sidebar ⇒ Object
41 42 43 44 45 46 47 |
# File 'app/components/arclight/document_component.rb', line 41 def (t('arclight.views.show.toggle_sidebar'), type: :button, class: 'btn btn-sm btn-secondary d-lg-none sidebar-toggle', data: { bs_toggle: 'offcanvas', bs_target: '#sidebar' }, aria: { controls: 'sidebar' }) end |