diff options
-rw-r--r-- | app/helpers/event_rendering_helper.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/event_rendering_helper.rb b/app/helpers/event_rendering_helper.rb index c2ce764..2f9bee8 100644 --- a/app/helpers/event_rendering_helper.rb +++ b/app/helpers/event_rendering_helper.rb @@ -198,9 +198,18 @@ module EventRenderingHelper end end else - action = action_for_event(:event_commented) do - " on " + link_to(h(repo.url_path + '/' + comment.sha1[0,7]), - repo_owner_path(repo, :project_repository_commit_path, project, repo, comment.sha1)+"##{dom_id(comment)}") + if comment.sha1.blank? # old-world repo comments + action = action_for_event(:event_commented) do + " on " + link_to(h(repo.url_path), + repo_owner_path(repo, :project_repository_comments_path, project, repo) + + "##{dom_id(comment)}") + end + else + action = action_for_event(:event_commented) do + " on " + link_to(h(repo.url_path + '/' + comment.sha1[0,7]), + repo_owner_path(repo, :project_repository_commit_path, project, repo, + comment.sha1)+"##{dom_id(comment)}") + end end end body = truncate(h(comment.body), :length => 150) |