Commit 6286b28b authored by Robert Speicher's avatar Robert Speicher
Browse files

Add an Event's target's title to its reference link

Given an activity feed entry like:

> Douwe Maan commented on [issue #123] at [gitlab-org/gitlab-ce]

...the `issue #123` link will now have a `title` attribute.
parent 3c04c89ee61a
......@@ -162,7 +162,7 @@ def event_note_title_html(event)
"#{event.note_target_type} #{truncate event.note_target.to_reference}"
end
else
link_to event_note_target_path(event) do
link_to event_note_target_path(event), title: event.target_title do
"#{event.note_target_type} #{truncate event.note_target.to_reference}"
end
end
......
......@@ -80,7 +80,7 @@ def project_name
end
def target_title
target.title if target && target.respond_to?(:title)
target.try(:title)
end
def created?
......
......@@ -19,6 +19,7 @@ class Note < ActiveRecord::Base
delegate :gfm_reference, :local_reference, to: :noteable
delegate :name, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true
delegate :title, to: :noteable, allow_nil: true
before_validation :set_award!
......
......@@ -4,7 +4,7 @@
= event_action_name(event)
- if event.target
%strong= link_to event.target.reference_link_text, [event.project.namespace.becomes(Namespace), event.project, event.target]
%strong= link_to event.target.reference_link_text, [event.project.namespace.becomes(Namespace), event.project, event.target], title: event.target_title
= event_preposition(event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment