Sha256: 5916033d023a7202aebda7b098a1f5f5972099dd6176254cd713882d07220b50

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module GeoConcerns
  class GeoConcernsShowPresenter < CurationConcerns::WorkShowPresenter
    delegate :spatial, :temporal, :issued, :coverage, :provenance, :layer_modified,
             :identifier, to: :solr_document
    class_attribute :file_format_service

    def geo_file_set_presenters
      # filter for geo file sets
      file_set_presenters.select do |member|
        file_format_service.include? member.solr_document[:geo_mime_type_tesim][0]
      end
    end

    def external_metadata_file_set_presenters
      # filter for external metadata files
      file_set_presenters.select do |member|
        MetadataFormatService.include? member.solr_document[:geo_mime_type_tesim][0]
      end
    end

    def parent_work_presenters
      # filter out collection presenters
      collection_presenters.select do |member|
        member.model_name.name != "Collection"
      end
    end

    def attribute_to_html(field, options = {})
      if field == :coverage
        GeoConcerns::CoverageRenderer.new(field, send(field), options).render
      else
        super field, options
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
geo_concerns-0.3.3 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.3.2 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.3.1 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.3.0 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.2.0 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.1.1 app/presenters/geo_concerns/geo_concerns_show_presenter.rb
geo_concerns-0.1.0 app/presenters/geo_concerns/geo_concerns_show_presenter.rb