Sha256: 283912f9d642596e3862122513c64105d6275e9f08b52419caa6090c2e5c85e2
Contents?: true
Size: 846 Bytes
Versions: 18
Compression:
Stored size: 846 Bytes
Contents
module CurationConcerns module Renderers class RightsAttributeRenderer < AttributeRenderer private def attribute_value_to_html(value) rights_attribute_to_html(value) end ## # Special treatment for license/rights. A URL from the Sufia gem's config/sufia.rb is stored in the descMetadata of the # curation_concern. If that URL is valid in form, then it is used as a link. If it is not valid, it is used as plain text. def rights_attribute_to_html(value) begin parsed_uri = URI.parse(value) rescue nil end if parsed_uri.nil? ERB::Util.h(value) else %(<a href=#{ERB::Util.h(value)} target="_blank">#{RightsService.label(value)}</a>) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems