2012-08-10 22:07:50 +00:00
|
|
|
= form_for [@project, @merge_request], html: { class: "new_merge_request form-horizontal" } do |f|
|
2012-01-28 15:21:00 +00: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 21:24:31 +00:00
|
|
|
|
2012-07-17 05:19:16 +00:00
|
|
|
%h4.cdark 1. Select Branches
|
|
|
|
%br
|
2012-06-13 17:02:30 +00:00
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
.row
|
2012-08-29 19:29:50 +00:00
|
|
|
.span5
|
2012-06-13 17:02:30 +00:00
|
|
|
.mr_branch_box
|
2012-06-13 06:03:53 +00:00
|
|
|
%h5 From (Head Branch)
|
2012-10-15 22:46:48 +00:00
|
|
|
.body
|
|
|
|
.padded= f.select(:source_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'})
|
2012-08-29 19:29:50 +00:00
|
|
|
.mr_source_commit
|
2012-06-13 06:03:53 +00:00
|
|
|
|
2012-08-29 19:29:50 +00:00
|
|
|
.span2
|
|
|
|
%center= image_tag "merge.png", class: 'mr_direction_tip'
|
|
|
|
.span5
|
2012-06-13 17:02:30 +00:00
|
|
|
.mr_branch_box
|
2012-06-13 06:03:53 +00:00
|
|
|
%h5 To (Base Branch)
|
|
|
|
.body
|
2012-10-15 22:46:48 +00:00
|
|
|
.padded= f.select(:target_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, {class: 'chosen span4'})
|
2012-08-29 19:29:50 +00:00
|
|
|
.mr_target_commit
|
2012-06-13 06:03:53 +00:00
|
|
|
|
2012-07-17 05:19:16 +00:00
|
|
|
%h4.cdark 2. Fill info
|
|
|
|
|
2012-01-28 15:21:00 +00:00
|
|
|
.clearfix
|
2012-07-17 05:19:16 +00:00
|
|
|
.main_box
|
|
|
|
.top_box_content
|
2012-10-12 06:19:34 +00:00
|
|
|
= f.label :title do
|
2012-07-17 05:19:16 +00:00
|
|
|
%strong= "Title *"
|
2012-10-12 06:19:34 +00:00
|
|
|
.input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5
|
2012-07-17 05:19:16 +00:00
|
|
|
.middle_box_content
|
2012-10-12 06:19:34 +00:00
|
|
|
= f.label :assignee_id do
|
|
|
|
%i.icon-user
|
2012-07-17 05:19:16 +00:00
|
|
|
Assign to
|
2012-09-10 06:09:55 +00:00
|
|
|
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
|
2011-12-13 21:24:31 +00:00
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
.control-group
|
|
|
|
|
2012-04-10 05:51:08 +00:00
|
|
|
.form-actions
|
2012-08-29 19:29:50 +00:00
|
|
|
= f.submit 'Save', class: "btn save-btn"
|
2012-01-28 15:21:00 +00:00
|
|
|
- if @merge_request.new_record?
|
2012-08-29 19:29:50 +00:00
|
|
|
= link_to project_merge_requests_path(@project), class: "btn cancel-btn" do
|
2012-01-28 15:21:00 +00:00
|
|
|
Cancel
|
2012-06-03 22:37:27 +00:00
|
|
|
- else
|
2012-08-29 19:29:50 +00:00
|
|
|
= link_to project_merge_request_path(@project, @merge_request), class: "btn cancel-btn" do
|
2012-01-28 15:21:00 +00:00
|
|
|
Cancel
|
2011-11-28 07:39:43 +00:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
2012-09-09 09:40:22 +00:00
|
|
|
disableButtonIfEmptyField("#merge_request_title", ".save-btn");
|
2012-06-13 06:03:53 +00:00
|
|
|
var source_branch = $("#merge_request_source_branch");
|
|
|
|
var target_branch = $("#merge_request_target_branch");
|
2012-03-13 21:54:49 +00:00
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() });
|
|
|
|
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() });
|
2012-03-13 21:54:49 +00:00
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
source_branch.live("change", function() {
|
2012-03-13 21:54:49 +00:00
|
|
|
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() });
|
|
|
|
});
|
|
|
|
|
2012-06-13 06:03:53 +00:00
|
|
|
target_branch.live("change", function() {
|
2012-03-13 21:54:49 +00:00
|
|
|
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() });
|
|
|
|
});
|
2011-11-28 07:39:43 +00:00
|
|
|
});
|