Skip to content

Commit

Permalink
Fixed problem with quoting multiple entries in Discuss/Task Journals
Browse files Browse the repository at this point in the history
  • Loading branch information
reddragon committed Jun 21, 2010
1 parent 9dcfcea commit 6cea3f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def inpage_new
original_comment.content = CGI.unescape(original_comment.content).gsub(/\n/,"<br>")
original_comment.content = enquote(original_comment.content)
#TODO: Fix multiple replies
#original_comment.content = original_comment.content + "\n\n" + previous_content
original_comment.content = original_comment.content + "\n\n" + previous_content
@comment.content = "(In reply to Comment # #{original_comment.id})" + original_comment.content
end
render :partial => "new", :locals => {:comment => @comment}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/journals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def inpage_new
if can_add_journal_entry?(@task)
@journal = Journal.new
@journal.task = @task
previous_content = params[:journal_content]
else
flash[:notice] = 'You are not authorized to add entries to the Task Journal.'
redirect_to project_task_path(@task.project, @task)
Expand All @@ -18,8 +19,7 @@ def inpage_new
original_journal.content = CGI.unescape(original_journal.content).gsub(/\n/,"<br>")
original_journal.content = enquote(original_journal.content)
@journal.content = "(In reply to Journal Entry # #{original_journal.id})" + original_journal.content
#TODO: Fix multiple replies
#original_journal.content = original_journal.content + "\n\n" + previous_content
original_journal.content = original_journal.content + "\n\n" + previous_content
@journal.content = "(In reply to Journal # #{original_journal.id})" + original_journal.content
end
render :partial => "new", :locals => {:journal => @journal}
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
- if can_delete_comment?(comment)
= link_to 'Delete', project_comment_path(@project, comment), :confirm => 'Are you sure?', :method => :delete
|
= link_to_remote 'Reply', {:update => "comment_space", :url => {:action => 'inpage_new', :project_id => @project.id, :reply_to_id => comment.id}, :with => "'comment_content=' + $('comment_content').value"}
= link_to_remote 'Reply', {:update => "comment_space", :url => {:action => 'inpage_new', :project_id => @project.id, :reply_to_id => comment.id}, :with => "'comment_content=' + encodeURIComponent($('comment_content').value)"}
%div{:id => "comment_space#{comment.id}"}

- if logged_in?
Expand Down
2 changes: 1 addition & 1 deletion app/views/journals/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- if can_delete_journal?(journal)
= link_to 'Delete', project_task_journal_path(@task.project, @task, journal), :confirm => 'Are you sure?', :method => :delete
&nbsp;|&nbsp;
= link_to_remote 'Reply', :update => "journal_space", :url => {:action => 'inpage_new', :project_id => @task.project.id, :task_id => @task.id, :reply_to_id => journal.id}
= link_to_remote 'Reply', {:update => "journal_space", :url => {:action => 'inpage_new', :project_id => @task.project.id, :task_id => @task.id, :reply_to_id => journal.id}, :with => "'journal_content=' + encodeURIComponent($('journal_content').value)"}
%div{:id => "journal_space#{journal.id}"}

%div{:id => 'journal_space'}
Expand Down

0 comments on commit 6cea3f9

Please sign in to comment.