diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -1795,6 +1795,10 @@ BIN_FILENODE = 7 margin-bottom: 20px; } +.pull-request-merge-refresh { + margin: 2px 7px; +} + .pull-request-merge ul { padding: 0px 0px; } diff --git a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako --- a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako +++ b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako @@ -52,30 +52,34 @@
${h.secure_form(h.route_path('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form', request=request)} <% merge_disabled = ' disabled' if c.pr_merge_possible is False else '' %> - ${_('refresh checks')} - + + % if c.allowed_to_close: + ## close PR action, injected later next to COMMENT button + % if c.pull_request_review_status == c.REVIEW_STATUS_APPROVED: + + ${_('Close with status {}').format(h.commit_status_lbl(c.REVIEW_STATUS_APPROVED))} + + % else: + + ${_('Close with status {}').format(h.commit_status_lbl(c.REVIEW_STATUS_REJECTED))} + + % endif + % endif + + ${h.end_form()} + +
+ ${_('refresh checks')} +
+
% elif c.rhodecode_user.username != h.DEFAULT_USER: ${_('refresh checks')} - + % else: % endif - % if c.allowed_to_close: - ## close PR action, injected later next to COMMENT button - - % endif diff --git a/rhodecode/templates/pullrequests/pullrequest_show.mako b/rhodecode/templates/pullrequests/pullrequest_show.mako --- a/rhodecode/templates/pullrequests/pullrequest_show.mako +++ b/rhodecode/templates/pullrequests/pullrequest_show.mako @@ -692,19 +692,10 @@ $('.pull-request-merge').css('opacity', 1); $('.action-buttons-extra').css('opacity', 1); - injectCloseAction(); } ); }; - injectCloseAction = function() { - var closeAction = $('#close-pull-request-action').html(); - var $actionButtons = $('.action-buttons-extra'); - // clear the action before - $actionButtons.html(""); - $actionButtons.html(closeAction); - }; - closePullRequest = function (status) { // inject closing flag $('.action-buttons-extra').append(''); @@ -800,8 +791,6 @@ window.commentFormGlobalSubmitSuccessCallback = function(){ refreshMergeChecks(); }; - // initial injection - injectCloseAction(); ReviewerAutoComplete('#user');