diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-02 02:43:51 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-10 15:32:25 +0300 |
commit | 1353cff5fed083fd7192dddff5062ac383b1f8a0 (patch) | |
tree | 290a06a1d034ea855e6fa398560a5ce250476eba /app/views | |
parent | 10aa99a30c311c59358d1547ebcbe0f6a92227a7 (diff) |
Replaces "Create merge request" link with one to the MR when one exists
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/commits/show.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/compare/_form.html.haml | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index ede64d47ab3..89e091203a3 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -11,7 +11,10 @@ = render 'shared/ref_switcher', destination: 'commits' .block-controls.hidden-xs.hidden-sm - - if create_mr_button?(@repository.root_ref, @ref) + - if @merge_request.present? + .control + = link_to "View #{@merge_request.to_reference}", namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-success' + - elsif create_mr_button?(@repository.root_ref, @ref) .control = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do = icon('plus') diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml index efc25eda26b..bdaa39055ad 100644 --- a/app/views/projects/compare/_form.html.haml +++ b/app/views/projects/compare/_form.html.haml @@ -13,12 +13,13 @@ = text_field_tag :to, params[:to], class: "form-control", required: true = button_tag "Compare", class: "btn btn-create commits-compare-btn" - - if create_mr_button? + - if @merge_request.present? + = link_to "View #{@merge_request.to_reference}", namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'prepend-left-10 btn' + - elsif create_mr_button? = link_to create_mr_path, class: 'prepend-left-10 btn' do = icon("plus") Create Merge Request - :javascript var availableTags = #{@project.repository.ref_names.to_json}; |