Sha256: b0577b48519af020a0a8e6bc8ebe29bea39ff9e7afcf8bf01aa0c633e37a1507

Contents?: true

Size: 647 Bytes

Versions: 21

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  # Displays the document
  # This overrides the title method to provide an edit link.
  class DocumentComponent < Blacklight::DocumentComponent
    def title
      return safe_join([exhibit_edit_link, super, add_document_meta_content(@document)]) if current_exhibit

      super
    end

    attr_reader :document

    delegate :current_exhibit, :can?, :add_document_meta_content, to: :helpers

    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
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
blacklight-spotlight-4.7.1 app/components/spotlight/document_component.rb
blacklight-spotlight-4.7.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.6.1 app/components/spotlight/document_component.rb
blacklight-spotlight-4.6.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.5.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.4.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.6 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.5 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.4 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.3 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.2 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.1 app/components/spotlight/document_component.rb
blacklight-spotlight-4.3.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.2.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.1.2 app/components/spotlight/document_component.rb
blacklight-spotlight-4.1.1 app/components/spotlight/document_component.rb
blacklight-spotlight-4.1.0 app/components/spotlight/document_component.rb
blacklight-spotlight-4.0.3 app/components/spotlight/document_component.rb
blacklight-spotlight-4.0.2 app/components/spotlight/document_component.rb
blacklight-spotlight-4.0.1 app/components/spotlight/document_component.rb