diff --git a/app/helpers/concepts_helper.rb b/app/helpers/concepts_helper.rb index 06949543e8..fc1f1cf419 100644 --- a/app/helpers/concepts_helper.rb +++ b/app/helpers/concepts_helper.rb @@ -105,12 +105,12 @@ def same_period?(year, month, date) year.eql?(date.year) && month.eql?(date.strftime('%B')) end - def concepts_li_list(concepts, auto_click: false) + def concepts_li_list(concepts, auto_click: false, selected_id: nil) out = '' concepts.each do |concept| children_link, data, href = concept_tree_data(@ontology.acronym, concept, request_lang, []) out += render TreeLinkComponent.new(child: concept, href: href, - children_href: '#', selected: concept.id.eql?(concepts.first.id) && auto_click, + children_href: '#', selected: concept.id.eql?(selected_id) && auto_click, target_frame: 'concept_show', data: data) end out @@ -132,15 +132,14 @@ def render_concepts_by_dates(auto_click: false) tmp = {} tmp[first_year] = first_month_concepts @concepts_year_month = tmp.merge(@concepts_year_month) - + selected_id = @concepts.first.id if @page.page.eql?(1) @concepts_year_month.each do |year, month_concepts| month_concepts.each do |month, concepts| out += "