Unverified Commit cd108a82 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Re-use issuable_form for new merge request

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 3f228230
......@@ -9,76 +9,13 @@
= link_to 'Change branches', mr_change_branches_path(@merge_request)
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f|
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form' } do |f|
= f.label :title, class: 'control-label' do
%strong Title *
= f.text_field :title, maxlength: 255, autofocus: true, class: 'form-control pad js-gfm-input', required: true
= f.label :description, 'Description', class: 'control-label'
= render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
= render 'projects/zen', f: f, attr: :description, classes: 'description form-control'
Parsed with
#{link_to 'Gitlab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
Attach files by dragging &amp; dropping
or #{link_to 'selecting them', '#', class: 'markdown-selector'}.
= f.label :assignee_id, class: 'control-label' do
Assign to
= users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id, project_id: @merge_request.target_project_id)
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
= f.label :milestone_id, class: 'control-label' do
- if milestone_options(@merge_request).present?
= f.select(:milestone_id, milestone_options(@merge_request), {include_blank: 'Select milestone'}, {class: 'select2'})
- else
%span.light No open milestones available.
- if can? current_user, :admin_milestone, @merge_request.target_project
= link_to 'Create new milestone', new_namespace_project_milestone_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
= f.label :label_ids, class: 'control-label' do
- if @merge_request.target_project.labels.any?
= f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, {selected: @merge_request.label_ids}, multiple: true, class: 'select2'
- else
%span.light No labels yet.
- if can? current_user, :admin_label, @merge_request.target_project
= link_to 'Create new label', new_namespace_project_label_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
- if guide_url = contribution_guide_url(@target_project)
Please review the
%strong #{link_to 'guidelines for contribution', guide_url}
to this repository.
= f.hidden_field :source_project_id
= f.hidden_field :source_branch
= f.hidden_field :target_project_id
= f.hidden_field :target_branch
= f.submit 'Submit merge request', class: 'btn btn-create'
= render 'projects/issuable_form', f: f, issuable: @merge_request
= f.hidden_field :source_project_id
= f.hidden_field :source_branch
= f.hidden_field :target_project_id
= f.hidden_field :target_branch
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