Commit f96827c4f017d5d8114d488d352695ed03c88c0a
1 parent
f82ec5b9
Fix dashboard lost if comment on commit
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
app/helpers/events_helper.rb
... | ... | @@ -83,4 +83,12 @@ module EventsHelper |
83 | 83 | render "events/event_push", event: event |
84 | 84 | end |
85 | 85 | end |
86 | + | |
87 | + def event_note_target_path(event) | |
88 | + if event.note? && event.note_commit? | |
89 | + project_commit_path(event.project, event.note_target) | |
90 | + else | |
91 | + url_for([event.project, event.note_target]) | |
92 | + end | |
93 | + end | |
86 | 94 | end | ... | ... |
app/views/events/event/_note.html.haml
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | = event.note_target_type |
7 | 7 | = link_to event.note_short_commit_id, project_commit_path(event.project, event.note_commit_id), class: "commit_short_id" |
8 | 8 | - else |
9 | - = link_to [event.project, event.note_target] do | |
9 | + = link_to event_note_target_path(event) do | |
10 | 10 | %strong |
11 | 11 | #{event.note_target_type} ##{truncate event.note_target_id} |
12 | 12 | ... | ... |