Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_form.html.haml « merge_requests « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d6febc6b7b62ba357bfbf8b0c69b77a7e86d394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
= form_for [@project, @merge_request], :html => { :class => "new_merge_request form-horizontal" } do |f|
  -if @merge_request.errors.any?
    .alert-message.block-message.error
      %ul
        - @merge_request.errors.full_messages.each do |msg|
          %li= msg

  .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
  .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
  .clearfix
    = 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")

  .form-actions
    = f.submit 'Save', :class => "btn-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() });
    });
  });