incubator-olio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r979926 - in /incubator/olio/webapp/rails/trunk/app: controllers/ helpers/ views/comments/ views/events/
Date Wed, 28 Jul 2010 01:51:53 GMT
Author: shanti
Date: Wed Jul 28 01:51:53 2010
New Revision: 979926

URL: http://svn.apache.org/viewvc?rev=979926&view=rev
Log:
Fix for OLIO-151. Patch provided by Xavier Dutreilh

Modified:
    incubator/olio/webapp/rails/trunk/app/controllers/events_controller.rb
    incubator/olio/webapp/rails/trunk/app/helpers/events_helper.rb
    incubator/olio/webapp/rails/trunk/app/views/comments/_comment.html.erb
    incubator/olio/webapp/rails/trunk/app/views/comments/_list.html.erb
    incubator/olio/webapp/rails/trunk/app/views/comments/_new.html.erb
    incubator/olio/webapp/rails/trunk/app/views/events/_tag_list.rhtml
    incubator/olio/webapp/rails/trunk/app/views/events/show.html.erb

Modified: incubator/olio/webapp/rails/trunk/app/controllers/events_controller.rb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/controllers/events_controller.rb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/controllers/events_controller.rb (original)
+++ incubator/olio/webapp/rails/trunk/app/controllers/events_controller.rb Wed Jul 28 01:51:53
2010
@@ -106,8 +106,8 @@ class EventsController < ApplicationCont
         @address.save!
         @event.address = @address
         
-        @event.image = Image.make_from_upload(params[:event_image], @event.id) if new_image?
-        @event.document = Document.make_from_upload(params[:event_document], @event.id) if
new_document?
+        @event.image = Image.make_from_upload(params[:event_image], @event.id, "events")
if new_image?
+        @event.document = Document.make_from_upload(params[:event_document], @event.id, "eventLits")
if new_document?
         
         @event.save! # must come after all other updates
         set_tags(@event)

Modified: incubator/olio/webapp/rails/trunk/app/helpers/events_helper.rb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/helpers/events_helper.rb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/helpers/events_helper.rb (original)
+++ incubator/olio/webapp/rails/trunk/app/helpers/events_helper.rb Wed Jul 28 01:51:53 2010
@@ -38,9 +38,9 @@ module EventsHelper
   def edit_delete_links(event)
     links = ""
     if logged_in? and event.user_id == session[:user_id]
-      links += button_to 'Edit', edit_event_path(event), :method => :get
+      links += button_to 'Edit', edit_event_path(event.id), :method => :get
       links += " "
-      links += button_to 'Delete', event, :confirm => 'Are you sure?', :method => :delete
+      links += button_to 'Delete', event_path(event.id), :confirm => 'Are you sure?',
:method => :delete
     end
     links += "\n"
   end

Modified: incubator/olio/webapp/rails/trunk/app/views/comments/_comment.html.erb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/views/comments/_comment.html.erb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/views/comments/_comment.html.erb (original)
+++ incubator/olio/webapp/rails/trunk/app/views/comments/_comment.html.erb Wed Jul 28 01:51:53
2010
@@ -35,7 +35,7 @@
 	<% if comment.author.id == session[:user_id] -%>
 	  <div id="comment_links">
 	    <%= link_to_function 'Edit', 
-        :href => edit_event_comment_path(@event, comment), 
+        :href => edit_event_comment_path(@event.id, comment), 
         :method => :get, :id => "edit_comment_#{comment.id}" do |page|
           page.insert_html :before, "edit_comment_#{comment.id}", 
             "<em class='edit_comment' id='editing_comment_#{comment.id}' style='color:#999;'>Editing...</em>"
@@ -50,7 +50,7 @@
         end
       %>
 		  or 
-		  <% link_to_remote 'Delete', 
+		  <%= link_to_remote 'Delete', 
 		     { :url => event_comment_path(comment.event, comment), :confirm => 'Are you sure?',
:method => :delete },
 		     :href => delete_event_comment_path(comment.event, comment) %>
 		  your comment

Modified: incubator/olio/webapp/rails/trunk/app/views/comments/_list.html.erb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/views/comments/_list.html.erb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/views/comments/_list.html.erb (original)
+++ incubator/olio/webapp/rails/trunk/app/views/comments/_list.html.erb Wed Jul 28 01:51:53
2010
@@ -1,4 +1,4 @@
-<!-
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -20,11 +20,11 @@
 
 <% cache({:controller => "events", :action => "show", :id => params[:id], :part
=> "event_comments"}, {:expire => 30.seconds.to_i}) do -%>
 
-<% if @comments.nil? or @comments.empty? -%>
+<% if @event.comments.nil? or @event.comments.empty? -%>
   <span class="subliminal">There are no comments for this event.</span>
 <% else -%>
   <ol id="comment_list">
-    <%= render :partial => 'comments/comment', :collection => @comments %>
+    <%= render :partial => 'comments/comment', :collection => @event.comments %>
   </ol>
 <% end -%>
 

Modified: incubator/olio/webapp/rails/trunk/app/views/comments/_new.html.erb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/views/comments/_new.html.erb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/views/comments/_new.html.erb (original)
+++ incubator/olio/webapp/rails/trunk/app/views/comments/_new.html.erb Wed Jul 28 01:51:53
2010
@@ -16,7 +16,7 @@
  * limitations under the License.
  * 
 -->
-<% remote_form_for :comment, @comment, :url => event_comments_path(@event), :method
=> :post, 
+<% remote_form_for :comment, @comment, :url => event_comments_path(@event.id), :method
=> :post, 
   :html => { :method => :post }, :before => "tinyMCE.triggerSave()" do |f| -%>
   
   <%= render :partial => "comments/form", :locals => { :f => f, :comment =>
@comment } %>

Modified: incubator/olio/webapp/rails/trunk/app/views/events/_tag_list.rhtml
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/views/events/_tag_list.rhtml?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/views/events/_tag_list.rhtml (original)
+++ incubator/olio/webapp/rails/trunk/app/views/events/_tag_list.rhtml Wed Jul 28 01:51:53
2010
@@ -18,7 +18,7 @@
 -->
 <%= tags_for(@event) %>
 <% if logged_in? -%>
-  <% form_remote_tag(:url => tag_event_path(@event), :html => {:method => 'put',
:id => 'event_tag_form'}) do  %>
+  <% form_remote_tag(:url => tag_event_path(@event.id), :html => {:method =>
'put', :id => 'event_tag_form'}) do  %>
     <input title="add tag" type="text" size="5" id="event_tag" name="tag" />
     <input type="submit" value="Add Tag" id="event_tag_commit" />
   <% end -%>

Modified: incubator/olio/webapp/rails/trunk/app/views/events/show.html.erb
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/rails/trunk/app/views/events/show.html.erb?rev=979926&r1=979925&r2=979926&view=diff
==============================================================================
--- incubator/olio/webapp/rails/trunk/app/views/events/show.html.erb (original)
+++ incubator/olio/webapp/rails/trunk/app/views/events/show.html.erb Wed Jul 28 01:51:53 2010
@@ -18,7 +18,6 @@
 -->
 <div id="event_header">
   <% cache({:controller => "events", :action => "show", :id => params[:id], :part
=> "main_event_details", :creator => (session[:user_id])}, {:expire => 30.seconds.to_i})
do -%>
-  end
     <div id="event_thumbnail"><%= thumbnail(@event.image) %></div>
     <div id="main_event_details">
       <h1 class="inline"><%=h @event.title %></h1> <%= edit_delete_links(@event)
%>
@@ -85,7 +84,7 @@
 	<% if logged_in? -%>
   	<%= 
   	  link_to_function "Add a comment",
-  	    :href => new_event_comment_path(@event), 
+  	    :href => new_event_comment_path(@event.id), 
         :method => :get, :id => "comment_link" do |page|
     	    page[:comment_form].visual_effect :blind_down
     	    page[:comment_add_link].hide



Mime
View raw message