Class: Spotlight::DocumentComponent

Inherits:
Blacklight::DocumentComponent
  • Object
show all
Defined in:
app/components/spotlight/document_component.rb

Overview

Displays the document This overrides the title method to provide an edit link.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



13
14
15
# File 'app/components/spotlight/document_component.rb', line 13

def document
  @document
end

Instance Method Details



17
18
19
# File 'app/components/spotlight/document_component.rb', line 17

def exhibit_edit_link
  helpers.exhibit_edit_link document, [:edit, current_exhibit, document], class: 'float-right float-end btn btn-primary' if can?(:curate, current_exhibit)
end

#titleObject



7
8
9
10
11
# File 'app/components/spotlight/document_component.rb', line 7

def title
  return safe_join([exhibit_edit_link, super, add_document_meta_content(@document)]) if current_exhibit

  super
end