Sha256: 7403151f27826e4dd9748969ebeff8abe60ff3b9361851b7c7700755a9f8dc9c
Contents?: true
Size: 1.01 KB
Versions: 13
Compression:
Stored size: 1.01 KB
Contents
module Hyrax::FileSetHelper def parent_path(parent) if parent.is_a?(Collection) main_app.collection_path(parent) else polymorphic_path([main_app, parent]) end end # REVIEW: Since this media display could theoretically work for # any object that inplements to_s and the Mime Type methos (image? audio? ...), # Should this really be in file_set or could it be in it's own helper class like media_helper? def media_display(presenter, locals = {}) render media_display_partial(presenter), locals.merge(file_set: presenter) end # rubocop:disable Metrics/MethodLength def media_display_partial(file_set) 'hyrax/file_sets/media_display/' + if file_set.image? 'image' elsif file_set.video? 'video' elsif file_set.audio? 'audio' elsif file_set.pdf? 'pdf' elsif file_set.office_document? 'office_document' else 'default' end end # rubocop:enable Metrics/MethodLength end
Version data entries
13 entries across 13 versions & 1 rubygems