Sha256: 0bebea8975fedd628d45a012124cac1b8c32d693c27c057e40fdcc968fb4f646
Contents?: true
Size: 962 Bytes
Versions: 13
Compression:
Stored size: 962 Bytes
Contents
module GeoConcerns module FileSetActionsHelper def file_set_actions(presenter, locals = {}) render file_set_actions_partial(presenter), locals.merge(file_set: presenter) end def file_set_actions_partial(file_set) format = file_set_actions_format(file_set) 'geo_concerns/file_sets/actions/' + if format format else 'default_actions' end end def file_set_actions_format(file_set) geo_mime_type = file_set.solr_document.fetch(:geo_mime_type_ssim, []).first if GeoConcerns::ImageFormatService.include?(geo_mime_type) 'image_actions' elsif GeoConcerns::VectorFormatService.include?(geo_mime_type) 'vector_actions' elsif GeoConcerns::RasterFormatService.include?(geo_mime_type) 'raster_actions' elsif GeoConcerns::MetadataFormatService.include?(geo_mime_type) 'metadata_actions' end end end end
Version data entries
13 entries across 13 versions & 1 rubygems