myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3378] branches/wf4ever/app: added a delete butto


From: noreply
Subject: [myexperiment-hackers] [3378] branches/wf4ever/app: added a delete button to pack resources
Date: Wed, 30 Jan 2013 05:50:46 +0000 (UTC)

Revision
3378
Author
dgc
Date
2013-01-30 05:50:45 +0000 (Wed, 30 Jan 2013)

Log Message

added a delete button to pack resources

Modified Paths

Diff

Modified: branches/wf4ever/app/controllers/packs_controller.rb (3377 => 3378)


--- branches/wf4ever/app/controllers/packs_controller.rb	2013-01-30 05:48:20 UTC (rev 3377)
+++ branches/wf4ever/app/controllers/packs_controller.rb	2013-01-30 05:50:45 UTC (rev 3378)
@@ -129,6 +129,15 @@
     render :resource_show
   end
 
+  def destroy_resource
+
+    session = ROSRS::Session.new(@pack.ro_uri, Conf.rodl_bearer_token)
+
+    session.delete_resource(@pack.ro_uri + params[:resource_path])
+
+    render(:partial => "items", :locals => { :pack => @pack, :authorised_to_edit => @authorised_to_edit })
+  end
+
   def transform_wf(ruri)
       service_uri = "http://sandbox.wf4ever-project.org/wf-ro/jobs"
       format = "application/vnd.taverna.t2flow+xml"
@@ -567,6 +576,7 @@
       "create_resource"    => "edit",
       "destroy"            => "destroy",
       "destroy_item"       => "destroy",
+      "destroy_resource"   => "edit",
       "download"           => "download",
       "edit"               => "edit",
       "edit_item"          => "edit",

Modified: branches/wf4ever/app/views/packs/_items.rhtml (3377 => 3378)


--- branches/wf4ever/app/views/packs/_items.rhtml	2013-01-30 05:48:20 UTC (rev 3377)
+++ branches/wf4ever/app/views/packs/_items.rhtml	2013-01-30 05:50:45 UTC (rev 3378)
@@ -107,6 +107,13 @@
             <% if not types.empty? %>
              (<%= types -%>)
             <% end %>  
+            <%= link_to_remote("<img src='' />",
+                :update => "pack_items", 
+                :url ="" pack_resources_path(pack) + '/' + e.ro_local_uri,
+                :method => :delete,
+                :complete => "new Effect.Highlight('pack_items', { duration: 1.5 });",
+                :confirm => "Are you sure you want to delete this resource?" )
+            %>
             </li>
           <% end %>
         <% end %>

Modified: branches/wf4ever/app/views/packs/show.rhtml (3377 => 3378)


--- branches/wf4ever/app/views/packs/show.rhtml	2013-01-30 05:48:20 UTC (rev 3377)
+++ branches/wf4ever/app/views/packs/show.rhtml	2013-01-30 05:50:45 UTC (rev 3378)
@@ -104,7 +104,9 @@
 				Items <span class="count_text">(<%= @pack.items_count -%>)</span>
 			</h4>
 			
-			<%= render :partial => "items", :locals => { :pack => @pack, :authorised_to_edit => @authorised_to_edit } -%>
+      <div id="pack_items">
+        <%= render :partial => "items", :locals => { :pack => @pack, :authorised_to_edit => @authorised_to_edit } -%>
+      </div>
 
 			<br/><br/>
 			<h4>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]