Commit 70212889 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Allow change assignee/milestone from MergeRequest show page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b05a67f4
......@@ -108,8 +108,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
@merge_request.reload_code
@merge_request.mark_as_unchecked
@merge_request.reset_events_cache
respond_to do |format|
format.js
format.html do
redirect_to [@merge_request.target_project, @merge_request], notice: 'Merge request was successfully updated.'
end
end
else
render "edit"
end
......
......@@ -4,7 +4,7 @@
\ and currently assigned to
- if can?(current_user, :modify_issue, @issue)
= project_users_select_tag('issue[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @issue.assignee_id)
= project_users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @issue.assignee_id)
- elsif issue.assignee
= link_to_member(@project, @issue.assignee)
......
= form_for [@project, @merge_request], remote: true, html: {class: 'edit-merge_request inline-update'} do |f|
Created by #{link_to_member(@project, merge_request.author)}&nbsp;
- if merge_request.assignee
\ and currently assigned to
- if can?(current_user, :modify_merge_request, @merge_request)
= project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @merge_request.assignee_id)
- elsif merge_request.assignee
= link_to_member(@project, @merge_request.assignee)
.pull-right.hidden-sm.hidden-xs
- if merge_request.milestone
- milestone = merge_request.milestone
%cite.cgray Attached to milestone
- if can?(current_user, :modify_merge_request, @merge_request)
= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone (none):" }, {class: 'select2 select2-compact'})
= hidden_field_tag :merge_request_context
= f.submit class: 'btn'
- elsif merge_request.milestone
= link_to merge_request.milestone.title, project_milestone_path
......@@ -4,15 +4,7 @@
.context
%cite.cgray
Created by #{link_to_member(@project, @merge_request.author)}.
- if @merge_request.assignee
Currently assigned to #{link_to_member(@project, @merge_request.assignee)}.
- if @merge_request.milestone
.pull-right
- milestone = @merge_request.milestone
%cite.cgray Attached to milestone
%strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
= render partial: 'projects/merge_requests/show/context', locals: { merge_request: @merge_request }
- if @merge_request.description.present?
.description
......
- if params[:merge_request_context]
$('.issue-box .context').effect('highlight');
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