X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2679a9f68531ee7c29ee4e1d68faef408de92d48..029656d8b2646bae51de03426a6496cbce0cc9d7:/apps/workbench/app/helpers/application_helper.rb?ds=sidebyside diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 030c365b00..624cb3d4c0 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -470,49 +470,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