Skip to content

Commit 294598e

Browse files
authored
Merge pull request #9376 from GilbertCherrie/fix_services_tags
Fix catalog item tags
2 parents fb03d2a + 044bbb3 commit 294598e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/helpers/catalog_helper/textual_summary.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module CatalogHelper::TextualSummary
22
def tags_from_record
33
tags = []
4+
tag_categories = Hash.new { |h, k| h[k] = [] }
45
@record.tags.each do |tag|
56
values = tag.name.split('/')
67
p = tags.find { |x| x[:label] == values[2].humanize }
@@ -9,9 +10,12 @@ def tags_from_record
910
p[:value].push(value)
1011
else
1112
name = Classification.find_by(:id => Classification.find_by(:tag_id => tag.id).parent_id).description
12-
tags.push(:icon => "fa fa-tag", :label => name, :value => [value])
13+
tag_categories[name] << value
1314
end
1415
end
16+
tag_categories.each do |tag_category, tag_values|
17+
tags.push(:icon => "fa fa-tag", :label => tag_category, :value => tag_values)
18+
end
1519
tags
1620
end
1721

0 commit comments

Comments
 (0)