Skip to content

Commit

Permalink
Fix: ontologies selector localization text and add "[view]" of the vi…
Browse files Browse the repository at this point in the history
…ews in the list (#791)

* fix ontologies selector weird results sentence

* show [view] beside ontology views in ontologies selector
  • Loading branch information
Bilelkihal authored Oct 30, 2024
1 parent 1aa8d38 commit 70f0e4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.ontologies-selector-results
.horizontal-line
.results-number
= t("ontologies.showing_ontologies_size", ontologies_size: @ontologies.length, analytics_size: @total_ontologies_number)
= t("ontologies.showing_ontologies_size", ontologies_size: @ontologies.length, analytics_size: @total_ontologies_number, portals: portal_name)
%span.select-all{'data-action': 'click->ontologies-selector#selectall'}
= t('ontologies_selector.select_all')
.ontologies
Expand Down

0 comments on commit 70f0e4d

Please sign in to comment.