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

53 lines
1.9 KiB
Plaintext
Raw Normal View History

2012-04-10 07:51:08 +02:00
= 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-04-10 07:51:08 +02:00
.control-group
= f.label :title, :class => "control-label"
.controls= f.text_area :title, :class => "input-xxlarge", :maxlength => 255, :rows => 5
.control-group
= f.label :source_branch, "From", :class => "control-label"
.controls
= f.select(:source_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
.mr_source_commit
2012-04-10 07:51:08 +02:00
.control-group
= f.label :target_branch, "To", :class => "control-label"
.controls
= f.select(:target_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px")
.mr_target_commit
2012-01-28 16:21:00 +01:00
.clearfix
2012-04-10 07:51:08 +02:00
= f.label :assignee_id, "Assign to", :class => "control-label"
.controls= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px")
2011-12-13 22:24:31 +01:00
2012-04-10 07:51:08 +02:00
.form-actions
= f.submit 'Save', :class => "btn-primary btn"
2012-01-28 16:21:00 +01:00
- 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
2011-11-28 08:39:43 +01:00
2011-12-13 19:40:45 +01:00
2011-11-28 08:39:43 +01:00
: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() });
});
2011-11-28 08:39:43 +01:00
});