BigW Consortium Gitlab

_how_to_merge.html.haml 2.1 KB
Newer Older
1
%div#modal_merge_info.modal.hide
Dmitriy Zaporozhets committed
2 3 4 5 6 7 8 9 10 11 12
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
        %h3 How to merge
      .modal-body
        - if @merge_request.for_fork?
          - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path
          - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path
          %p
            %strong Step 1.
13
            Checkout the branch we are going to merge and pull in the code
Dmitriy Zaporozhets committed
14 15
          %pre.dark
            :preserve
16 17
              git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch}
              git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch}
Dmitriy Zaporozhets committed
18 19
          %p
            %strong Step 2.
20
            Merge the branch and push the changes to GitLab
Dmitriy Zaporozhets committed
21 22
          %pre.dark
            :preserve
23 24 25
              git checkout #{@merge_request.target_branch}
              git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch}
              git push origin #{@merge_request.target_branch}
Dmitriy Zaporozhets committed
26 27 28
        - else
          %p
            %strong Step 1.
29
            Update the repo and checkout the branch we are going to merge
Dmitriy Zaporozhets committed
30 31 32
          %pre.dark
            :preserve
              git fetch origin
33
              git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch}
Dmitriy Zaporozhets committed
34 35
          %p
            %strong Step 2.
36
            Merge the branch and push the changes to GitLab
Dmitriy Zaporozhets committed
37 38
          %pre.dark
            :preserve
39 40
              git checkout #{@merge_request.target_branch}
              git merge --no-ff #{@merge_request.source_branch}
Dmitriy Zaporozhets committed
41
              git push origin #{@merge_request.target_branch}
42 43 44 45 46 47 48 49 50


:javascript
  $(function(){
    var modal = $('#modal_merge_info').modal({modal: true, show:false});
    $('.how_to_merge_link').bind("click", function(){
      modal.show();
    });
    $('.modal-header .close').bind("click", function(){
51
      modal.hide();
52 53
    })
  })