Commit f96827c4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix dashboard lost if comment on commit

parent f82ec5b9
...@@ -83,4 +83,12 @@ module EventsHelper ...@@ -83,4 +83,12 @@ module EventsHelper
render "events/event_push", event: event render "events/event_push", event: event
end end
end end
def event_note_target_path(event)
if event.note? && event.note_commit?
project_commit_path(event.project, event.note_target)
else
url_for([event.project, event.note_target])
end
end
end end
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= event.note_target_type = event.note_target_type
= link_to event.note_short_commit_id, project_commit_path(event.project, event.note_commit_id), class: "commit_short_id" = link_to event.note_short_commit_id, project_commit_path(event.project, event.note_commit_id), class: "commit_short_id"
- else - else
= link_to [event.project, event.note_target] do = link_to event_note_target_path(event) do
%strong %strong
#{event.note_target_type} ##{truncate event.note_target_id} #{event.note_target_type} ##{truncate event.note_target_id}
......
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