This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow the user to allow comments or not on a page, blog post
- Loading branch information
Josh Adams
committed
Jan 26, 2009
1 parent
b92cb6b
commit 5aa3349
Showing
8 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
module CommentsHelper | ||
def show_comments_for(commentable) | ||
render :partial => 'shared/comments', :locals => { :commentable => commentable } | ||
if commentable.settings["allow_comments"] | ||
render :partial => 'shared/comments', :locals => { :commentable => commentable } | ||
end | ||
end | ||
|
||
def show_comment_form_for(commentable, options={}) | ||
raise "No return path specified" unless options[:return_path] | ||
comment = Comment.new | ||
comment.commentable = commentable | ||
render :partial => 'shared/comment_form', :locals => { :comment => comment, :commentable => commentable, :return_path => options[:return_path] } | ||
if commentable.settings["allow_comments"] | ||
comment = Comment.new | ||
comment.commentable = commentable | ||
render :partial => 'shared/comment_form', :locals => { :comment => comment, :commentable => commentable, :return_path => options[:return_path] } | ||
end | ||
end | ||
|
||
def show_comment(comment) | ||
render :partial => 'shared/comment', :locals => { :comment => comment } | ||
end | ||
|
||
def show_comment_info_link_for(commentable, options={}) | ||
rause "No path specified" unless options[:path] | ||
render :partial => 'shared/comment_info_link', :locals => { :commentable => commentable, :path => options[:path] } | ||
raise "No path specified" unless options[:path] | ||
if commentable.settings["allow_comments"] | ||
render :partial => 'shared/comment_info_link', :locals => { :commentable => commentable, :path => options[:path] } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters