diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-04-21 12:22:56 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-04-21 12:22:56 +0300 |
commit | 08994f3f6034eb214de4cda304d8797a51b2397a (patch) | |
tree | 4a2b2cf4d3dec5c9300bbd25a6dc4091cd80a14d /app/views | |
parent | 9af14e4bda3586d520c576911ecf109879f41aed (diff) | |
parent | 3a6694b5516f4c5015a7745cf8182e74597b39ad (diff) | |
download | gitlab-ce-08994f3f6034eb214de4cda304d8797a51b2397a.tar.gz |
Merge remote-tracking branch 'origin/merge_button'
Conflicts:
app/assets/javascripts/merge_requests.js
db/schema.rb
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/merge_requests/automerge.js.haml | 7 | ||||
-rw-r--r-- | app/views/merge_requests/show.html.haml | 37 |
2 files changed, 42 insertions, 2 deletions
diff --git a/app/views/merge_requests/automerge.js.haml b/app/views/merge_requests/automerge.js.haml new file mode 100644 index 00000000000..93e184455af --- /dev/null +++ b/app/views/merge_requests/automerge.js.haml @@ -0,0 +1,7 @@ +-if @status + :plain + location.reload(); +-else + :plain + MergeRequest.already_cannot_be_merged() + diff --git a/app/views/merge_requests/show.html.haml b/app/views/merge_requests/show.html.haml index 8402a66ed19..56345c394c8 100644 --- a/app/views/merge_requests/show.html.haml +++ b/app/views/merge_requests/show.html.haml @@ -8,7 +8,6 @@ %span.right - if can?(current_user, :modify_merge_request, @merge_request) - if @merge_request.open? - = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" = link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "btn small padded", :title => "Close merge request" = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small padded" do Edit @@ -53,6 +52,34 @@ Closed by #{@merge_request.closed_event.author_name} %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. + +- if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) + .automerge_widget.can_be_merged{:style => "display:none"} + .ui-box.padded + %p + You can accept this request automatically. If you still want to do it manually - #{link_to "click here", "#", :class => "how_to_merge_link vlink", :title => "How To Merge"} for instructions + = link_to "Accept Merge Request", automerge_project_merge_request_path(@project, @merge_request), :class => "btn small info accept_merge_request", :remote => true + + + .automerge_widget.cannot_be_merged{:style => "display:none"} + .alert-message + %p + %strong This request cant be merged with GitLab. You should do it manually + = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" + + .automerge_widget.unchecked + .alert-message + %p + %strong Checking for ability to automatically mergeā¦ + + .automerge_widget.already_cannot_be_merged{:style => "display:none"} + .alert-message + %p + %strong This merge request already can not be merged + + + + = render "merge_requests/commits" - unless @commits.empty? @@ -72,7 +99,13 @@ :javascript $(function(){ - MergeRequest.init(); + MergeRequest.init({ + url_to_automerge_check: "#{automerge_check_project_merge_request_path(@project, @merge_request)}", + }); + + $(".accept_merge_request").live("ajax:beforeSend", function() { + $(this).replaceWith('#{image_tag "ajax_loader.gif"}'); + }) }) = render "notes/per_line_form" |