[ARVADOS] updated: 0dea965e36e7ac52a789e31b45fc70f1925c4190

Git user git at public.curoverse.com
Fri Mar 24 11:37:32 EDT 2017


Summary of changes:
 apps/workbench/app/controllers/collections_controller.rb  | 13 +++++++++++++
 apps/workbench/app/views/collections/_show_files.html.erb |  7 +++++++
 apps/workbench/config/routes.rb                           |  1 +
 3 files changed, 21 insertions(+)

       via  0dea965e36e7ac52a789e31b45fc70f1925c4190 (commit)
      from  bbacca53ce2e9eabe3c8e02cee8d3650864bd3f1 (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 0dea965e36e7ac52a789e31b45fc70f1925c4190
Author: radhika <radhika at curoverse.com>
Date:   Fri Mar 24 11:37:00 2017 -0400

    3821: remove selection file in collection file row

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index fc7fd88..c377796 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -308,6 +308,19 @@ class CollectionsController < ApplicationController
     end
   end
 
+  def rename_selected_file
+    arv_coll = Arv::Collection.new(@object.manifest_text)
+    source_paths[uuids[0]].each do |p|
+      arv_coll.rename "./"+params[:src], "./"+params[:dst]
+    end
+
+    if @object.update_attributes manifest_text: arv_coll.manifest_text
+      show
+    else
+      self.render_error status: 422
+    end
+  end
+
   protected
 
   def find_usable_token(token_list)
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index a363bae..f7a94fc 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -93,6 +93,13 @@
                 } %>
             <span> </span>
             <% end %>
+
+            <% if @object.editable? %>
+                <%= link_to({action: 'remove_selected_files', id: @object.uuid, selection: [object.portable_data_hash+'/'+file_path]}, method: :post, remote: true, data: {confirm: "Remove #{file_path}?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: "Remove #{file_path}") do %>
+                  <i class="fa fa-fw fa-trash-o"></i>
+                <% end %>
+            <% end %>
+
         <% if CollectionsHelper::is_image(filename) %>
             <i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
           <div class="collection_files_inline">
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 0eef73f..9ea4a35 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -88,6 +88,7 @@ ArvadosWorkbench::Application.routes.draw do
     post 'unshare', :on => :member
     get 'choose', on: :collection
     post 'remove_selected_files', on: :member
+    post 'rename_selected_file', on: :member
   end
   get('/collections/download/:uuid/:reader_token/*file' => 'collections#show_file',
       format: false)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list