Sha256: 7acd8ee59dedbb6ef47ef0ba470f18ea70bcefc57a542350cf80688e6ea6f439

Contents?: true

Size: 791 Bytes

Versions: 6

Compression:

Stored size: 791 Bytes

Contents

module Geoblacklight
  ##
  # Adds custom functionality for Geoblacklight document presentation
  class DocumentPresenter < Blacklight::IndexPresenter
    include ActionView::Helpers::OutputSafetyHelper
    ##
    # Presents configured index fields in search results. Passes values through
    # configured helper_method. Multivalued fields separated by presenter
    # field_value_separator (default: comma). Fields separated by period.
    # @return [String]
    def index_fields_display
      fields_values = []
      @configuration.index_fields.each do |field_name, _|
        val = field_value(field_name)
        unless val.blank?
          val += '.' unless val.end_with?('.')
          fields_values << val
        end
      end
      safe_join(fields_values, ' ')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geoblacklight-1.9.1 app/presenters/geoblacklight/document_presenter.rb
geoblacklight-1.9.0 app/presenters/geoblacklight/document_presenter.rb
geoblacklight-1.8.0 app/presenters/geoblacklight/document_presenter.rb
geoblacklight-1.7.1 app/presenters/geoblacklight/document_presenter.rb
geoblacklight-1.7.0 app/presenters/geoblacklight/document_presenter.rb
geoblacklight-1.6.0 app/presenters/geoblacklight/document_presenter.rb