'
end
def license_url(code, type)
key = "#{code}-#{type}"
return unless LICENSES.key?(key)
LICENSES[key][:link]
end
def license_description(code, type)
key = "#{code}-#{type}"
return unless LICENSES.key?(key) && LICENSES[key][:desc]
LICENSES[key][:desc]
end
def access_label(element)
type = normalize_type(element)
return access_labels[type] if access_labels.key?(type)
I18n.t('mods_display.access_condition')
end
def normalize_type(element)
type = element.attributes['type']
return type.value.strip.gsub(/\s*/, '').downcase if type.respond_to?(:value)
''
end
def access_labels
{ 'useandreproduction' => I18n.t('mods_display.use_and_reproduction'),
'restrictiononaccess' => I18n.t('mods_display.restriction_on_access'),
'copyright' => I18n.t('mods_display.copyright'),
'license' => I18n.t('mods_display.license')
}
end
end
end