Commit 89043d6b891057d756b2f9f518d0eb043ce07a19
1 parent
b729004a
Exists in
master
and in
4 other branches
MR: Accept section polished. Show permission info
Showing
2 changed files
with
37 additions
and
12 deletions
Show diff stats
app/assets/stylesheets/common.scss
@@ -969,3 +969,23 @@ li.note { | @@ -969,3 +969,23 @@ li.note { | ||
969 | vertical-align:top; | 969 | vertical-align:top; |
970 | } | 970 | } |
971 | } | 971 | } |
972 | + | ||
973 | +.automerge_widget { | ||
974 | + | ||
975 | + &.can_be_merged { | ||
976 | + background: #DFF0D8; | ||
977 | + } | ||
978 | + | ||
979 | + .accept_merge_request { | ||
980 | + color: #fff; | ||
981 | + text-shadow: 0 1px 1px #222; | ||
982 | + background: #5bb75b;; | ||
983 | + &:hover { | ||
984 | + background-color: #51a351; | ||
985 | + color: #fff; | ||
986 | + } | ||
987 | + } | ||
988 | + .how_to_merge_link { | ||
989 | + @extend .primary; | ||
990 | + } | ||
991 | +} |
app/views/merge_requests/show.html.haml
@@ -53,30 +53,35 @@ | @@ -53,30 +53,35 @@ | ||
53 | Closed by #{@merge_request.closed_event.author_name} | 53 | Closed by #{@merge_request.closed_event.author_name} |
54 | %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. | 54 | %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. |
55 | 55 | ||
56 | +- unless can?(current_user, :accept_mr, @project) | ||
57 | + .alert-message | ||
58 | + %strong Only masters can accept MR | ||
59 | + | ||
56 | 60 | ||
57 | - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) | 61 | - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) |
58 | .automerge_widget.can_be_merged{:style => "display:none"} | 62 | .automerge_widget.can_be_merged{:style => "display:none"} |
59 | - .ui-box.padded | ||
60 | - %p | 63 | + .alert.alert-success |
64 | + %span | ||
65 | + = link_to "Accept Merge Request", automerge_project_merge_request_path(@project, @merge_request), :class => "btn small info accept_merge_request", :remote => true | ||
66 | + | ||
61 | 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 | 67 | 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 |
62 | - = link_to "Accept Merge Request", automerge_project_merge_request_path(@project, @merge_request), :class => "btn small info accept_merge_request", :remote => true | ||
63 | - | ||
64 | 68 | ||
65 | .automerge_widget.cannot_be_merged{:style => "display:none"} | 69 | .automerge_widget.cannot_be_merged{:style => "display:none"} |
66 | - .alert-message | ||
67 | - %p | ||
68 | - %strong This request cant be merged with GitLab. You should do it manually | 70 | + .alert.alert-info |
71 | + %span | ||
69 | = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" | 72 | = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" |
73 | + | ||
74 | + %strong This request cant be merged with GitLab. You should do it manually | ||
70 | 75 | ||
71 | .automerge_widget.unchecked | 76 | .automerge_widget.unchecked |
72 | .alert-message | 77 | .alert-message |
73 | - %p | ||
74 | - %strong Checking for ability to automatically merge… | 78 | + %strong |
79 | + %i.icon-refresh | ||
80 | + Checking for ability to automatically merge… | ||
75 | 81 | ||
76 | .automerge_widget.already_cannot_be_merged{:style => "display:none"} | 82 | .automerge_widget.already_cannot_be_merged{:style => "display:none"} |
77 | - .alert-message | ||
78 | - %p | ||
79 | - %strong This merge request already can not be merged | 83 | + .alert.alert-info |
84 | + %strong This merge request already can not be merged. Try to reload page. | ||
80 | 85 | ||
81 | 86 | ||
82 | 87 |