diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb index 3aeb67409..b665017a1 100644 --- a/app/presenters/comment_presenter.rb +++ b/app/presenters/comment_presenter.rb @@ -3,7 +3,8 @@ class CommentPresenter < ApplicationPresenter include PullRequestHelper attr_accessor :comment, :options - attr_reader :header, :image, :date, :caption, :content, :buttons, :is_reference_to_issue, :item + attr_reader :header, :image, :date, :caption, :content, :buttons, :is_reference_to_issue, + :reference_project def initialize(comment, opts = {}) @is_reference_to_issue = !!(comment.automatic && comment.created_from_issue_id) # is it reference issue from another issue @@ -111,7 +112,7 @@ class CommentPresenter < ApplicationPresenter end.html_safe end - def item - @comment + def reference_project + @referenced_issue.project end end diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index 965fa6cb0..988f324cd 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -4,7 +4,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter attr_accessor :commit attr_reader :header, :image, :date, :caption, :content, :expandable, - :is_reference_to_issue, :committer, :item + :is_reference_to_issue, :committer, :reference_project def initialize(commit, opts = {}) comment = opts[:comment] @@ -77,8 +77,8 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter false end - def item - @commit + def reference_project + @project end protected diff --git a/app/views/shared/_feed_message.html.haml b/app/views/shared/_feed_message.html.haml index 09e448d3c..f3c26aa68 100644 --- a/app/views/shared/_feed_message.html.haml +++ b/app/views/shared/_feed_message.html.haml @@ -1,4 +1,4 @@ --if !presenter.is_reference_to_issue || can?(:show, presenter.item) +-if !presenter.is_reference_to_issue || can?(:show, presenter.reference_project) .activity{:id => presenter.comment_id? ? presenter.comment_anchor : ''} .top - if presenter.buttons?