[ARVADOS] updated: 6898695ece3f2bf8b02f292e3808d532f5704352

Git user git at public.curoverse.com
Tue May 23 15:07:06 EDT 2017


Summary of changes:
 apps/workbench/app/controllers/projects_controller.rb      | 14 +++++++++++++-
 .../app/views/projects/_show_contents_rows.html.erb        | 10 ++++++++--
 apps/workbench/app/views/projects/untrashed_item.js.erb    |  4 ++++
 apps/workbench/config/routes.rb                            |  1 +
 4 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 apps/workbench/app/views/projects/untrashed_item.js.erb

       via  6898695ece3f2bf8b02f292e3808d532f5704352 (commit)
      from  820cd60245b86032f81fb1265e7f5074aa38ff79 (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 6898695ece3f2bf8b02f292e3808d532f5704352
Author: radhika <radhika at curoverse.com>
Date:   Tue May 23 15:06:35 2017 -0400

    9587: trash tab

diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 4009f12..9797c66 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -98,7 +98,11 @@ class ProjectsController < ApplicationController
       } if current_user
     pane_list << { :name => 'Sharing',
                    :count => @share_links.count } if @user_is_manager
-    pane_list << { :name => 'Trash' }
+    pane_list <<
+      {
+        :name => 'Trash',
+        :filters => [%w(uuid is_a arvados#collection)] + [['is_trashed', '=', true]]
+      }
     pane_list << { :name => 'Advanced' }
   end
 
@@ -178,6 +182,14 @@ class ProjectsController < ApplicationController
     end
   end
 
+  def untrash
+    updates = {}
+    updates[:trash_at] = nil
+    ArvadosBase.find(params[:item_uuid]).update_attributes updates
+    @untrashed_uuid = params[:item_uuid]
+    render template: 'projects/untrashed_item'
+  end
+
   def destroy
     while (objects = Link.filter([['owner_uuid','=', at object.uuid],
                                   ['tail_uuid','=', at object.uuid]])).any?
diff --git a/apps/workbench/app/views/projects/_show_contents_rows.html.erb b/apps/workbench/app/views/projects/_show_contents_rows.html.erb
index 5f0f60b..e8876f4 100644
--- a/apps/workbench/app/views/projects/_show_contents_rows.html.erb
+++ b/apps/workbench/app/views/projects/_show_contents_rows.html.erb
@@ -13,8 +13,14 @@
 
     <td>
       <% if @object.editable? %>
-        <%= link_to({action: 'remove_item', id: @object.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :delete, remote: true, data: {confirm: "Remove #{object.class_for_display.downcase} #{name_object.name rescue object.uuid} from this project?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: 'remove') do %>
-          <i class="fa fa-fw fa-trash-o"></i>
+        <% if object.trash_at != nil %>
+          <%= link_to({action: 'untrash', id: @object.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :post, remote: true, data: {confirm: "Undelete #{object.class_for_display.downcase} #{name_object.name rescue object.uuid}?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: 'un-delete') do %>
+            <i class="fa fa-fw fa-recycle"></i>
+          <% end %>
+        <% else %>
+          <%= link_to({action: 'remove_item', id: @object.uuid, item_uuid: ((name_link && name_link.uuid) || object.uuid)}, method: :delete, remote: true, data: {confirm: "Remove #{object.class_for_display.downcase} #{name_object.name rescue object.uuid} from this project?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate', title: 'remove') do %>
+            <i class="fa fa-fw fa-trash-o"></i>
+          <% end %>
         <% end %>
       <% else %>
         <i class="fa fa-fw"></i><%# placeholder %>
diff --git a/apps/workbench/app/views/projects/untrashed_item.js.erb b/apps/workbench/app/views/projects/untrashed_item.js.erb
new file mode 100644
index 0000000..3cb5b17
--- /dev/null
+++ b/apps/workbench/app/views/projects/untrashed_item.js.erb
@@ -0,0 +1,4 @@
+$(document).trigger('count-change');
+$('[data-object-uuid=<%= @untrashed_uuid %>]').hide('slow', function() {
+	$(this).remove();
+});
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 0eef73f..c277b95 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -96,6 +96,7 @@ ArvadosWorkbench::Application.routes.draw do
   resources :projects do
     match 'remove/:item_uuid', on: :member, via: :delete, action: :remove_item
     match 'remove_items', on: :member, via: :delete, action: :remove_items
+    post 'untrash', :on => :member
     get 'choose', on: :collection
     post 'share_with', on: :member
     get 'tab_counts', on: :member

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list