From 4884226299c246a958f3247d0c4bb4e328732d90 Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Tue, 29 Oct 2024 15:43:31 +0100 Subject: [PATCH] show [view] beside ontology views in ontologies selector --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3f69732af..acf5335c1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 }