Commit 89043d6b authored by randx's avatar randx

MR: Accept section polished. Show permission info

parent b729004a
...@@ -969,3 +969,23 @@ li.note { ...@@ -969,3 +969,23 @@ li.note {
vertical-align:top; vertical-align:top;
} }
} }
.automerge_widget {
&.can_be_merged {
background: #DFF0D8;
}
.accept_merge_request {
color: #fff;
text-shadow: 0 1px 1px #222;
background: #5bb75b;;
&:hover {
background-color: #51a351;
color: #fff;
}
}
.how_to_merge_link {
@extend .primary;
}
}
...@@ -53,30 +53,35 @@ ...@@ -53,30 +53,35 @@
Closed by #{@merge_request.closed_event.author_name} Closed by #{@merge_request.closed_event.author_name}
%small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago.
- unless can?(current_user, :accept_mr, @project)
.alert-message
%strong Only masters can accept MR
- if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project)
.automerge_widget.can_be_merged{:style => "display:none"} .automerge_widget.can_be_merged{:style => "display:none"}
.ui-box.padded .alert.alert-success
%p %span
= link_to "Accept Merge Request", automerge_project_merge_request_path(@project, @merge_request), :class => "btn small info accept_merge_request", :remote => true
 
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 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"} .automerge_widget.cannot_be_merged{:style => "display:none"}
.alert-message .alert.alert-info
%p %span
%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" = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge"
 
%strong This request cant be merged with GitLab. You should do it manually
.automerge_widget.unchecked .automerge_widget.unchecked
.alert-message .alert-message
%p %strong
%strong Checking for ability to automatically merge… %i.icon-refresh
Checking for ability to automatically merge…
.automerge_widget.already_cannot_be_merged{:style => "display:none"} .automerge_widget.already_cannot_be_merged{:style => "display:none"}
.alert-message .alert.alert-info
%p %strong This merge request already can not be merged. Try to reload page.
%strong This merge request already can not be merged
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment