myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3699] branches/packs/app: fixed issues with web


From: noreply
Subject: [myexperiment-hackers] [3699] branches/packs/app: fixed issues with web site progression when adding / deleting annotations
Date: Tue, 10 Sep 2013 16:03:25 +0000 (UTC)

Revision
3699
Author
dgc
Date
2013-09-10 16:03:25 +0000 (Tue, 10 Sep 2013)

Log Message

fixed issues with web site progression when adding / deleting annotations

Modified Paths

Diff

Modified: branches/packs/app/controllers/annotations_controller.rb (3698 => 3699)


--- branches/packs/app/controllers/annotations_controller.rb	2013-09-10 14:57:20 UTC (rev 3698)
+++ branches/packs/app/controllers/annotations_controller.rb	2013-09-10 16:03:25 UTC (rev 3699)
@@ -61,8 +61,12 @@
         :content_type => 'application/rdf+xml',
         :resources    => targets,
         :creator_uri  => user_path(current_user))
-    
-    redirect_to polymorphic_path(@context)
+
+    if template["redirect"]
+      redirect_to resource_path_fixed(@context, @context.find_resource_by_ore_path(params[template["redirect"]]))
+    else
+      redirect_to polymorphic_path(@context)
+    end
   end
 
   def destroy
@@ -76,7 +80,11 @@
 
     @context.research_object.update_manifest!
 
-    redirect_to polymorphic_path(address@hidden, :annotations])
+    if params[:source]
+      redirect_to resource_path_fixed(@context, @context.find_resource_by_ore_path(params[:source]))
+    else
+      redirect_to polymorphic_path(address@hidden, :annotations])
+    end
   end
 
   def new

Modified: branches/packs/app/views/annotations/_annotation.html.erb (3698 => 3699)


--- branches/packs/app/views/annotations/_annotation.html.erb	2013-09-10 14:57:20 UTC (rev 3698)
+++ branches/packs/app/views/annotations/_annotation.html.erb	2013-09-10 16:03:25 UTC (rev 3699)
@@ -3,7 +3,7 @@
     <p>
       <div style="float: right">
       <%= link_to("<img src='' />",
-          polymorphic_path([context, :annotation], :id => annotation[:annotation].uuid),
+          polymorphic_path([context, :annotation], :id => annotation[:annotation].uuid, :source => source),
           :method => :delete,
           :confirm => "Are you sure you want to delete this annotation?") %>
       </div>

Modified: branches/packs/app/views/annotations/index.html.erb (3698 => 3699)


--- branches/packs/app/views/annotations/index.html.erb	2013-09-10 14:57:20 UTC (rev 3698)
+++ branches/packs/app/views/annotations/index.html.erb	2013-09-10 16:03:25 UTC (rev 3699)
@@ -2,6 +2,6 @@
 
 <% @annotations.each do |annotation| %>
   <% next unless annotation[:template] %>
-  <%= render(:partial => 'annotation', :locals => { :context => @context, :annotation => annotation  } ) -%>
+  <%= render(:partial => 'annotation', :locals => { :context => @context, :annotation => annotation, :source => nil } ) -%>
 <% end %>
 

Modified: branches/packs/app/views/items/show.html.erb (3698 => 3699)


--- branches/packs/app/views/items/show.html.erb	2013-09-10 14:57:20 UTC (rev 3698)
+++ branches/packs/app/views/items/show.html.erb	2013-09-10 16:03:25 UTC (rev 3699)
@@ -5,6 +5,7 @@
 <div class="tabContainer">
   <div class="tabTitle">Overview</div>
   <div class="tabContent">
+    <a name="overview"></a>
 
     <h2>Metadata</h2>
 
@@ -126,8 +127,9 @@
 <div class="tabContainer">
   <div class="tabTitle">Annotations</div>
   <div class="tabContent">
+    <a name="annotations"></a>
     <% @visible_annotations.each do |annotation| %>
-      <%= render(:partial => "annotations/annotation", :locals => { :context => @context, :annotation => annotation } ) -%>
+      <%= render(:partial => "annotations/annotation", :locals => { :context => @context, :annotation => annotation, :source => @item.ore_path } ) -%>
     <% end %>
   </div>
 </div>

reply via email to

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