app/helpers/application_helper.rb
# Used in V2 to provide semi-useful alternative text for data object image representations
# TODO: These alt/title attributes are fairly useless in terms of accessibility.
# We used to show part of the description, but that caused us to use Sanitize, sometimes
# multiple times which was horrendous for performance. We used to use the I18n key
# "#{en_type}_alt_text". We should think about what the best alt text would be and
# figure out how to get that as fast as possible (alternative to Sanitize? No sanitizing at all?)
Used in V2 to provide semi-useful alternative text for data object image representations
TODO: These alt/title attributes are fairly useless in terms of accessibility.
We used to show part of the description, but that caused us to use Sanitize, sometimes
multiple times which was horrendous for performance. We used to use the I18n key
"#{en_type}_alt_text". We should think about what the best alt text would be and
figure out how to get that as fast as possible (alternative to Sanitize. No sanitizing at all?)
Used in V2 to provide semi - useful alternative text for data object image representations TODO : These alt / title attributes are fairly useless in terms of accessibility . We used to show part of the description but that caused us to use Sanitize sometimes multiple times which was horrendous for performance . We used to use the I18n key " # { en_type } _alt_text " . We should think about what the best alt text would be and figure out how to get that as fast as possible ( alternative to Sanitize . No sanitizing at all? )
def alternative_text(data_object, en_type, taxon_concept = nil)
    if taxon_concept && taxon_concept.class == TaxonConcept && title = taxon_concept.title_canonical
      I18n.t("#{en_type}_of_taxon", taxon_name: title)
    else
      I18n.t("item_type_#{en_type}_assistive", taxon_name: title)
    end
  end
def alternative_text ( data_object , en_type , taxon_concept = nil ) if taxon_concept && taxon_concept . class == TaxonConcept && title = taxon_concept . title_canonical I18n . t ( "#{en_type}_of_taxon" , taxon_name : title ) else I18n . t ( "item_type_#{en_type}_assistive" , taxon_name : title ) end end
Used in V2 to provide semi-useful alternative text for data object image representations
TODO: These alt/title attributes are fairly useless in terms of accessibility.
Used in V2 to provide semi - useful alternative text for data object image representations TODO : These alt / title attributes are fairly useless in terms of accessibility .
data_object
<not_specific>
en_type
<not_specific>
taxon_concept
<not_specific>