Class: Spotlight::DocumentAdminTableComponent

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(component: 'tr', **kwargs) ⇒ DocumentAdminTableComponent

Returns a new instance of DocumentAdminTableComponent.



7
8
9
# File 'app/components/spotlight/document_admin_table_component.rb', line 7

def initialize(component: 'tr', **kwargs)
  super
end

Instance Method Details

#classesObject



11
12
13
# File 'app/components/spotlight/document_admin_table_component.rb', line 11

def classes
  super + ['doc-row']
end

#timestampObject



15
16
17
18
19
20
21
# File 'app/components/spotlight/document_admin_table_component.rb', line 15

def timestamp
  return unless presenter.document[presenter.configuration.index.timestamp_field]

  l Date.parse(presenter.document[presenter.configuration.index.timestamp_field])
rescue StandardError
  nil
end