Skip to content

Commit

Permalink
show [view] beside ontology views in ontologies selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Oct 29, 2024
1 parent 849c55b commit 4884226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ def error_message_alert
end

def onts_for_select(include_views: false)
ontologies ||= LinkedData::Client::Models::Ontology.all({include: "acronym,name", include_views: include_views})
ontologies ||= LinkedData::Client::Models::Ontology.all({include: "acronym,name,viewOf", include_views: include_views})
onts_for_select = [['', '']]
ontologies.each do |ont|
next if ( ont.acronym.nil? or ont.acronym.empty? )
acronym = ont.acronym
name = ont.name
abbreviation = acronym.empty? ? "" : "(#{acronym})"
ont_label = "#{name.strip} #{abbreviation}"
ont_label = "#{name.strip} #{abbreviation}#{ont.viewOf ? ' [view]' : ''}"
onts_for_select << [ont_label, acronym]
end
onts_for_select.sort! { |a,b| a[0].downcase <=> b[0].downcase }
Expand Down

0 comments on commit 4884226

Please sign in to comment.