53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
= form_for [@project, @merge_request] do |f|
|
|
-if @merge_request.errors.any?
|
|
.alert-message.block-message.error
|
|
%ul
|
|
- @merge_request.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
.clearfix
|
|
= f.label :title
|
|
.input= f.text_area :title, :class => "xxlarge", :maxlength => 255, :rows => 5
|
|
.clearfix
|
|
= f.label :source_branch, "From"
|
|
.input
|
|
= f.select(:source_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
|
|
.mr_source_commit
|
|
.clearfix
|
|
= f.label :target_branch, "To"
|
|
.input
|
|
= f.select(:target_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
|
|
.mr_target_commit
|
|
.clearfix
|
|
= f.label :assignee_id, "Assign to"
|
|
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px")
|
|
|
|
.actions
|
|
= f.submit 'Save', :class => "primary btn"
|
|
- if @merge_request.new_record?
|
|
= link_to project_merge_requests_path(@project), :class => "btn" do
|
|
Cancel
|
|
- else
|
|
= link_to project_merge_request_path(@project, @merge_request), :class => "btn" do
|
|
Cancel
|
|
|
|
|
|
|
|
:javascript
|
|
$(function(){
|
|
$('select#merge_request_assignee_id').chosen();
|
|
$('select#merge_request_source_branch').chosen();
|
|
$('select#merge_request_target_branch').chosen();
|
|
|
|
|
|
|
|
$("#merge_request_source_branch").live("change", function() {
|
|
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() });
|
|
});
|
|
|
|
$("#merge_request_target_branch").live("change", function() {
|
|
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() });
|
|
});
|
|
});
|
|
|