X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/aab0fe9d849952d926a252fac1fedd7e643f5a00..66d12ae6dc72d45cc3cb3fcc007cb41371371616:/apps/workbench/app/helpers/application_helper.rb diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 7231ff8add..b17231336f 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -218,27 +218,27 @@ module ApplicationHelper dn += '[value]' end - items = [] + selectables = [] attrtext = attrvalue if dataclass and dataclass.is_a? Class if attrvalue and !attrvalue.empty? Link.where(head_uuid: attrvalue, link_class: ["tag", "identifier"]).each do |tag| attrtext += " [#{tag.name}]" end - items.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s}) + selectables.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s}) end #dataclass.where(uuid: attrvalue).each do |item| - # items.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s}) + # selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s}) #end itemuuids = [] dataclass.limit(10).each do |item| itemuuids << item.uuid - items.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s}) + selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s}) end Link.where(head_uuid: itemuuids, link_class: ["tag", "identifier"]).each do |tag| - items.each do |item| - if item.uuid == tag.head_uuid - item.name += ' [' + tag.name + ']' + selectables.each do |selectable| + if selectable['uuid'] == tag.head_uuid + selectable['name'] += ' [' + tag.name + ']' end end end @@ -260,8 +260,8 @@ module ApplicationHelper lt += raw("\n