app/helpers/application_helper.rb
# will return the class name and label used to generate the colored box showing
# this object's curation status: Green/Trusted, Gray/Unreviewed, Red/Untrusted, Red/Hidden
# or if none available: nil, nil
# NOTE - this assumes you have loaded either @taxon_page (preferred) or @taxon_concept.
will return the class name and label used to generate the colored box showing
this object's curation status: Green/Trusted, Gray/Unreviewed, Red/Untrusted, Red/Hidden
or if none available: nil, nil
NOTE - this assumes you have loaded either @taxon_page (preferred) or @taxon_concept.
will return the class name and label used to generate the colored box showing this object ' s curation status : Green / Trusted Gray / Unreviewed Red / Untrusted Red / Hidden or if none available : nil nil NOTE - this assumes you have loaded either @taxon_page ( preferred ) or @taxon_concept .
def status_class_and_label_for_data_object(data_object)
    vis = data_object.visibility_by_taxon_concept(@taxon_page || @taxon_concept)
    vet = data_object.vetted_by_taxon_concept(@taxon_page || @taxon_concept)
    if vis == Visibility.get_invisible
      return 'untrusted', I18n.t(:hidden)
    else
      status_class = case vet
        when Vetted.unknown       then 'unknown'
        when Vetted.untrusted     then 'untrusted'
        when Vetted.trusted       then 'trusted'
        when Vetted.inappropriate then 'inappropriate'
        else nil
      end
      status_label = case vet
        when Vetted.unknown then I18n.t(:unreviewed)
        else vet.label
      end
      return status_class, status_label
    end
    return nil, nil
  end
def status_class_and_label_for_data_object ( data_object ) vis = data_object . visibility_by_taxon_concept ( @taxon_page || @taxon_concept ) vet = data_object . vetted_by_taxon_concept ( @taxon_page || @taxon_concept ) if vis == Visibility . get_invisible return 'untrusted' , I18n . t ( :hidden ) else status_class = case vet when Vetted . unknown then 'unknown' when Vetted . untrusted then 'untrusted' when Vetted . trusted then 'trusted' when Vetted . inappropriate then 'inappropriate' else nil end status_label = case vet when Vetted . unknown then I18n . t ( :unreviewed ) else vet . label end return status_class , status_label end return nil , nil end
will return the class name and label used to generate the colored box showing
this object's curation status: Green/Trusted, Gray/Unreviewed, Red/Untrusted, Red/Hidden
or if none available: nil, nil
NOTE - this assumes you have loaded either @taxon_page (preferred) or @taxon_concept.
will return the class name and label used to generate the colored box showing this object ' s curation status : Green / Trusted Gray / Unreviewed Red / Untrusted Red / Hidden or if none available : nil nil NOTE - this assumes you have loaded either @taxon_page ( preferred ) or @taxon_concept .
# Well, shoot. We can't use #label here, because #label is translated.
data_object
<not_specific>