2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-12-19 15:30:14 +00:00
|
|
|
module CommentsHelper
|
2012-04-04 22:43:06 +01:00
|
|
|
def project_commentable_comment_path(project, commentable, comment)
|
|
|
|
case
|
|
|
|
when Comment.issue_comment?(commentable.class)
|
|
|
|
project_issue_comment_path(project, commentable, comment)
|
|
|
|
when Comment.commit_comment?(commentable.class)
|
|
|
|
project_commit_comment_path(project, commentable, comment)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def project_commentable_path(project, commentable)
|
|
|
|
case
|
|
|
|
when Comment.issue_comment?(commentable.class)
|
|
|
|
polymorphic_path [project, commentable]
|
|
|
|
when Comment.commit_comment?(commentable.class)
|
|
|
|
commit_path project, commentable.id
|
|
|
|
end
|
|
|
|
end
|
2011-12-19 15:30:14 +00:00
|
|
|
end
|