X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2679a9f68531ee7c29ee4e1d68faef408de92d48..41887dd213cfa165925e94d4f3bb120edeb1a30d:/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 030c365b00..66b7ed662a 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -93,7 +93,7 @@ module ApplicationHelper if opts[:friendly_name] if attrvalue.respond_to? :friendly_link_name - link_name = attrvalue.friendly_link_name + link_name = attrvalue.friendly_link_name opts[:lookup] else begin if resource_class.name == 'Collection' @@ -150,9 +150,7 @@ module ApplicationHelper def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={}) attrvalue = object.send(attr) if attrvalue.nil? - if !object.attribute_editable?(attr, :ever) or - (!object.editable? and - !object.owner_uuid.in?(my_projects.collect(&:uuid))) + if not object.attribute_editable?(attr) if attrvalue && attrvalue.length > 0 return render_attribute_as_textile( object, attr, attrvalue, false ) else @@ -241,10 +239,7 @@ module ApplicationHelper preconfigured_search_str = value_info[:search_for] end - if !object or - !object.attribute_editable?(attr, :ever) or - (!object.editable? and - !object.owner_uuid.in?(my_projects.collect(&:uuid))) + if not object.andand.attribute_editable?(attr) return link_to_if_arvados_object attrvalue end @@ -470,49 +465,8 @@ module ApplicationHelper end end - def move_or_copy_items action, uuids_to_add, target_uuid - uuids_to_add = [ uuids_to_add ] unless uuids_to_add.is_a? Array - uuids_to_add. - collect { |x| ArvadosBase::resource_class_for_uuid(x) }. - uniq. - each do |resource_class| - resource_class.filter([['uuid','in',uuids_to_add]]).each do |src| - if resource_class == Collection and not Collection.attribute_info.include?(:name) - dst = Link.new(owner_uuid: target_uuid, - tail_uuid: target_uuid, - head_uuid: src.uuid, - link_class: 'name', - name: src.uuid) - else - case action - when :copy - dst = src.dup - if dst.respond_to? :'name=' - if dst.name - dst.name = "Copy of #{dst.name}" - else - dst.name = "Copy of unnamed #{dst.class_for_display.downcase}" - end - end - if resource_class == Collection - dst.manifest_text = Collection.select([:manifest_text]).where(uuid: src.uuid).first.manifest_text - end - when :move - dst = src - else - raise ArgumentError.new "Unsupported action #{action}" - end - dst.owner_uuid = target_uuid - dst.tail_uuid = target_uuid if dst.class == Link - end - begin - dst.save! - rescue - dst.name += " (#{Time.now.localtime})" if dst.respond_to? :name= - dst.save! - end - end - end + def render_localized_date(date, opts="") + raw("#{date}") end private