From fa810e4f85a2f30535af44538428866b09d630a4 Mon Sep 17 00:00:00 2001 From: Jan Christophersen Date: Tue, 14 Feb 2017 14:56:25 +0100 Subject: [PATCH] Add Links to Branches in Calendar Activity --- app/views/users/calendar_activities.html.haml | 14 +++++++++----- .../26287-link-branch-in-calendar-activity.yml | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 changelogs/unreleased/26287-link-branch-in-calendar-activity.yml diff --git a/app/views/users/calendar_activities.html.haml b/app/views/users/calendar_activities.html.haml index dae147ca8be..4afd31f788b 100644 --- a/app/views/users/calendar_activities.html.haml +++ b/app/views/users/calendar_activities.html.haml @@ -10,13 +10,17 @@ %i.fa.fa-clock-o = event.created_at.to_s(:time) - if event.push? - #{event.action_name} #{event.ref_type} #{event.ref_name} + #{event.action_name} #{event.ref_type} + %strong + - commits_path = namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) + = link_to_if event.project.repository.branch_exists?(event.ref_name), event.ref_name, commits_path - else = event_action_name(event) - - if event.note? - %strong= link_to event.note_target.to_reference, event_note_target_path(event) - - elsif event.target - %strong= link_to event.target.to_reference, [event.project.namespace.becomes(Namespace), event.project, event.target] + %strong + - if event.note? + = link_to event.note_target.to_reference, event_note_target_path(event) + - elsif event.target + = link_to event.target.to_reference, [event.project.namespace.becomes(Namespace), event.project, event.target] at %strong diff --git a/changelogs/unreleased/26287-link-branch-in-calendar-activity.yml b/changelogs/unreleased/26287-link-branch-in-calendar-activity.yml new file mode 100644 index 00000000000..35855578d21 --- /dev/null +++ b/changelogs/unreleased/26287-link-branch-in-calendar-activity.yml @@ -0,0 +1,4 @@ +--- +title: Add Links to Branches in Calendar Activity +merge_request: 9224 +author: Jan Christophersen