Sha256: ea7e4a62d8c6bab81e6ed605e2277e2b60b09209c9239701ec733178cab616b6

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

module Spotlight
  module Base
    extend ActiveSupport::Concern

    include Blacklight::Base
    include Spotlight::Config

    # This overwrites Blacklight::Configurable#blacklight_config
    def blacklight_config
      exhibit_specific_blacklight_config
    end

    def autocomplete_json_response document_list
      document_list.map do |doc|
        {
          id: doc.id,
          title: CGI.unescapeHTML(view_context.presenter(doc).document_heading.to_str),
          thumbnail: doc.first(blacklight_config.index.thumbnail_field),
          thumbnails: doc.spotlight_image_versions.try(:thumb) || doc[blacklight_config.index.thumbnail_field],
          full_image_url: doc.spotlight_image_versions.try(:full).try(:first),
          full_images: doc.spotlight_image_versions.try(:full),
          image_versions: doc.spotlight_image_versions.image_versions(:thumb, :full),
          description: doc.id,
          url: exhibit_catalog_path(current_exhibit, doc),
          private: doc.private?(current_exhibit),
          global_id: doc.to_global_id.to_s
        }
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 lib/spotlight/base.rb