Skip to content

Commit

Permalink
Ooops, I had a problem with *successfully* posting a comment. Heh.
Browse files Browse the repository at this point in the history
git-svn-id: file:///data/subversion/eol/trunk@1998 78829999-583a-0410-bd01-8a9b849fd409
  • Loading branch information
jrice committed May 26, 2010
1 parent 4df01b9 commit 8abaaa2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/comments_controller.rb
Expand Up @@ -22,7 +22,7 @@ class CommentsController < ApplicationController
params[:page] = (parent_object.visible_comments(current_user).length.to_f / Comment.per_page.to_f).ceil
prepare_index
render :update do |page|
page.replace_html params[:body_div_name].blank? ? 'commentsContain' : params[:body_div_name], {:partial => 'index.js',
page.replace_html params[:body_div_name].blank? ? 'commentsContain' : params[:body_div_name], {:partial => 'index.js.haml',
:locals => {:body_div_name => params[:body_div_name].blank? ? 'commentsContain' : params[:body_div_name]},
:object => [parent_object, current_object] }
end
Expand Down
35 changes: 35 additions & 0 deletions app/views/comments/_index.js.haml
@@ -0,0 +1,35 @@
/ TODO - More elegant solution than rendering html in a .js.haml file...
#commentsContain
- if body_div_name =~ /^text/
= link_to_function('', "Effect.DropOut($('#{body_div_name}').parentNode)", :class=>'close-button')
.controls
- if @slim_container
- info = page_entries_info current_objects
= info == 'No entries found' ? 'Comments' : "#{info},"
on
= @title_label
= will_paginate(current_objects, :renderer => 'RemoteLinkRenderer', :remote => {(current_objects[0].parent_type.tableize.singularize + "_id").to_sym => parent_object.id, :update => body_div_name, :body_div_name => body_div_name }) unless current_objects[0].nil?
- if @title != ''
%div
%h2
= @title
- else
%h2
Comments
%b
On
= @title_label
= @title
= will_paginate(current_objects, :renderer => 'RemoteLinkRenderer', :remote => {(current_objects[0].parent_type.tableize.singularize + "_id").to_sym => parent_object.id, :update => body_div_name, :body_div_name => body_div_name } ) unless current_objects[0].nil?
%small
- info = page_entries_info current_objects
= info == 'No entries found' ? '' : info
- if current_objects.empty?
%p#no-comments
No comments have been left yet.
- else
%ul.comments
= render :partial => 'list'
= will_paginate(current_objects, :renderer => 'RemoteLinkRenderer', :remote => {(current_objects[0].parent_type.tableize.singularize + "_id").to_sym => parent_object.id, :update => body_div_name, :body_div_name => body_div_name } ) unless current_objects[0].nil?
#new-comment
= render :partial => 'new', :locals => { :length => 4, :body_div_name => body_div_name }

0 comments on commit 8abaaa2

Please sign in to comment.