Sha256: 38d77abf165041596f1d7febd4c7219bee146eeb832cc76c17b093d8d2184efa
Contents?: true
Size: 882 Bytes
Versions: 13
Compression:
Stored size: 882 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">#{CurationConcerns.config.license_service_class.new.label(value)}</a>) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems