[ARVADOS] updated: 9daab730fefab219c707fcc15f5e7e599b8b716a

git at public.curoverse.com git at public.curoverse.com
Thu Dec 4 13:37:16 EST 2014


Summary of changes:
 apps/workbench/app/helpers/application_helper.rb | 57 +++++++-----------------
 1 file changed, 15 insertions(+), 42 deletions(-)

       via  9daab730fefab219c707fcc15f5e7e599b8b716a (commit)
      from  960f0d26421023473d7b3ca26d5f8be7f9ec0b61 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9daab730fefab219c707fcc15f5e7e599b8b716a
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu Dec 4 13:32:00 2014 -0500

    4525: keep link_to in application_helper, which will be used when attr value is a String or Fixnum etc

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 3c70b66..92d1a63 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -322,49 +322,22 @@ module ApplicationHelper
       datatype = 'text'
     end
 
-    # preload data
-    preload_uuids = []
-    items = []
-    selectables = []
-
-    attrtext = attrvalue
-    if dataclass.is_a? Class and dataclass < ArvadosBase
-      objects = get_n_objects_of_class dataclass, 10
-      objects.each do |item|
-        items << item
-        preload_uuids << item.uuid
-      end
-      if attrvalue and !attrvalue.empty?
-        preload_uuids << attrvalue
-      end
-      preload_links_for_objects preload_uuids
-
-      if attrvalue and !attrvalue.empty?
-        links_for_object(attrvalue).each do |link|
-          if link.link_class.in? ["tag", "identifier"]
-            attrtext += " [#{link.name}]"
-          end
-        end
-        selectables.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
-      end
-      itemuuids = []
-      items.each do |item|
-        itemuuids << item.uuid
-        selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
-      end
+    lt = link_to attrtext, '#', {
+      "data-emptytext" => "none",
+      "data-placement" => "bottom",
+      "data-type" => datatype,
+      "data-url" => url_for(action: "update", id: object.uuid, controller: object.class.to_s.pluralize.underscore, merge: true),
+      "data-title" => "Set value for #{subattr[-1].to_s}",
+      "data-name" => dn,
+      "data-pk" => "{id: \"#{object.uuid}\", key: \"#{object.class.to_s.underscore}\"}",
+      "data-value" => attrvalue,
+      # "clear" button interferes with form-control's up/down arrows
+      "data-clear" => false,
+      :class => "editable #{'required' if required} form-control",
+      :id => id
+    }.merge(htmloptions)
 
-      itemuuids.each do |itemuuid|
-        links_for_object(itemuuid).each do |link|
-          if link.link_class.in? ["tag", "identifier"]
-            selectables.each do |selectable|
-              if selectable['uuid'] == link.head_uuid
-                selectable['name'] += ' [' + link.name + ']'
-              end
-            end
-          end
-        end
-      end
-    end
+    lt
   end
 
   def render_arvados_object_list_start(list, button_text, button_href,

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list