Sha256: f1d29214cc7c71b689d1da19ddea737663e57833a71aa855ed60d9bcc4e56d8e

Contents?: true

Size: 796 Bytes

Versions: 12

Compression:

Stored size: 796 Bytes

Contents

module Blacklight
  module GalleryHelper
    def render_gallery_collection documents
      index = -1
      documents.map do |object|
        index += 1
        template = gallery_wrapper_template(object)
        template.render(self, {document: object, document_counter: index}) if template

      end.join().html_safe
    end

    def gallery_wrapper_template(object)
      format = document_partial_name(object, nil)
      ['index_gallery_%{format}_wrapper', 'index_gallery'].each do |str|
        partial = str % { format: format }
        logger.debug "Looking for gallery document wrapper #{partial}"
        template = lookup_context.find_all(partial, lookup_context.prefixes, true, [:document, :document_counter], {}).first
        return template if template
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blacklight-gallery-0.7.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.6.1 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.6.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.4.1 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.5.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.4.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.3.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.2.1 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.2.0 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.1.2 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.1.1 app/helpers/blacklight/gallery_helper.rb
blacklight-gallery-0.1.0 app/helpers/blacklight/gallery_helper.rb