Commit 1df2908b authored by Douwe Maan's avatar Douwe Maan

Link to branches from MR "Request to merge X into Y" sentence

parent 7a65cb3a
...@@ -26,9 +26,10 @@ ...@@ -26,9 +26,10 @@
%li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff) %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
.normal .normal
%span Request to merge %span Request to merge
%span.label-branch #{source_branch_with_namespace(@merge_request)} = link_to source_branch_with_namespace(@merge_request), namespace_project_commits_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), class: "label-branch"
%span into %span into
%span.label-branch #{@merge_request.target_branch} = link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do
= @merge_request.target_branch
= render "projects/merge_requests/show/how_to_merge" = render "projects/merge_requests/show/how_to_merge"
= render "projects/merge_requests/widget/show.html.haml" = render "projects/merge_requests/widget/show.html.haml"
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
- if !@merge_request.source_branch_exists? - if !@merge_request.source_branch_exists?
= succeed '.' do = succeed '.' do
The changes were merged into The changes were merged into
%span.label-branch= @merge_request.target_branch = link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do
= @merge_request.target_branch
The source branch has been removed. The source branch has been removed.
- elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) - elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch)
...@@ -18,7 +19,8 @@ ...@@ -18,7 +19,8 @@
%p %p
= succeed '.' do = succeed '.' do
The changes were merged into The changes were merged into
%span.label-branch= @merge_request.target_branch = link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do
= @merge_request.target_branch
You can remove the source branch now. You can remove the source branch now.
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
%i.fa.fa-times %i.fa.fa-times
......
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