Skip to content

Commit

Permalink
use main_language_label helper in ontology_viewer_page_name
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Sep 4, 2023
1 parent 74a4440 commit c9c8d2a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def get_link_for_label_xl_ajax(label_xl, ont_acronym, cls_id)

###END ruby equivalent of JS code in bp_ajax_controller.
def ontology_viewer_page_name(ontology_name, concept_label, page)
ontology_name + " | " + select_language_label(concept_label)[1] + " - #{page.capitalize}"
ontology_name + " | " + main_language_label(concept_label) + " - #{page.capitalize}"
end


Expand Down
11 changes: 1 addition & 10 deletions app/helpers/collections_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ def get_collections_labels(collections, main_uri = '')
end
end

collections_labels.sort_by! do |s|
pref_label = s['prefLabel']

if pref_label.is_a? String
pref_label
else
pref_label.last
end
end

collections_labels = sorted_labels(collections_labels)
collections_labels.unshift selected_label if selected_label
[collections_labels, selected_label]
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/multi_languages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def select_language_label(concept_label, platform_languages = %i[en fr])
end

def main_language_label(label)
select_language_label(label).last
select_language_label(label)&.last
end

def display_in_multiple_languages(label)
Expand Down
5 changes: 1 addition & 4 deletions app/helpers/schemes_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def get_schemes_labels(schemes, main_uri)
end

schemes_labels = sorted_labels(schemes_labels)

if selected_label
schemes_labels.unshift selected_label
end
schemes_labels.unshift selected_label if selected_label
[schemes_labels, selected_label]
end

Expand Down

0 comments on commit c9c8d2a

Please sign in to comment.