diff options
author | Drew Blessing <drew@gitlab.com> | 2016-06-23 17:36:24 +0300 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2016-07-06 20:58:57 +0300 |
commit | 0b34cac1c5f0115b7ea6ed0e1e08b57ee22671cd (patch) | |
tree | 994799b4a45124cdb978ee09cb754cf29e50cc8a /app | |
parent | 71448673264efc8c6e74267295eff81331fd7f0e (diff) |
Show last push widget in upstream after push to fork
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/projects_helper.rb | 6 | ||||
-rw-r--r-- | app/views/projects/_last_push.html.haml | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 88787576dd3..3bbbb26cff2 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -293,7 +293,11 @@ module ProjectsHelper end def last_push_event - if current_user + return unless current_user + + if fork = current_user.fork_of(@project) + current_user.recent_push(fork.id) + else current_user.recent_push(@project.id) end end diff --git a/app/views/projects/_last_push.html.haml b/app/views/projects/_last_push.html.haml index 434d8644b83..3c6b931f41a 100644 --- a/app/views/projects/_last_push.html.haml +++ b/app/views/projects/_last_push.html.haml @@ -7,7 +7,9 @@ %span You pushed to = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) do %strong= event.ref_name - branch + - if @project && event.project != @project + %span at + %strong= link_to_project event.project #{time_ago_with_tooltip(event.created_at)} .pull-right |