gitlabhq/app/views/merge_requests/_form.html.haml

76 lines
2.7 KiB
Plaintext
Raw Normal View History

= form_for [@project, @merge_request], html: { class: "new_merge_request form-horizontal" } do |f|
2012-01-28 16:21:00 +01:00
-if @merge_request.errors.any?
.alert-message.block-message.error
%ul
- @merge_request.errors.full_messages.each do |msg|
%li= msg
2011-12-13 22:24:31 +01:00
2012-07-17 07:19:16 +02:00
%h4.cdark 1. Select Branches
%br
2012-06-13 19:02:30 +02:00
.row
.span5
2012-06-13 19:02:30 +02:00
.mr_branch_box
%h5 From (Head Branch)
.body
.padded= f.select(:source_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'})
.mr_source_commit
.span2
%center= image_tag "merge.png", class: 'mr_direction_tip'
.span5
2012-06-13 19:02:30 +02:00
.mr_branch_box
%h5 To (Base Branch)
.body
.padded= f.select(:target_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'})
.mr_target_commit
2012-07-17 07:19:16 +02:00
%h4.cdark 2. Fill info
2012-01-28 16:21:00 +01:00
.clearfix
.merge_requests_form_box
2012-07-17 07:19:16 +02:00
.top_box_content
= f.label :title do
2012-07-17 07:19:16 +02:00
%strong= "Title *"
2012-12-19 04:14:05 +01:00
.input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true
.merge_requests_middle_box
.merge_requests_assignee
= f.label :assignee_id do
%i.icon-user
Assign to
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
.merge_requests_milestone
= f.label :milestone_id do
%i.icon-time
Milestone
.input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
2011-12-13 22:24:31 +01:00
.control-group
2012-04-10 07:51:08 +02:00
.form-actions
= f.submit 'Save', class: "btn save-btn"
2012-01-28 16:21:00 +01:00
- if @merge_request.new_record?
= link_to project_merge_requests_path(@project), class: "btn cancel-btn" do
2012-01-28 16:21:00 +01:00
Cancel
- else
= link_to project_merge_request_path(@project, @merge_request), class: "btn cancel-btn" do
2012-01-28 16:21:00 +01:00
Cancel
2011-11-28 08:39:43 +01:00
:javascript
$(function(){
disableButtonIfEmptyField("#merge_request_title", ".save-btn");
var source_branch = $("#merge_request_source_branch");
var target_branch = $("#merge_request_target_branch");
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() });
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() });
source_branch.live("change", function() {
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() });
});
target_branch.live("change", function() {
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() });
});
2011-11-28 08:39:43 +01:00
});