diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-09-20 17:41:15 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-10-02 17:17:55 +0300 |
commit | e2056f08f072805a132bf18879749e401d8ad620 (patch) | |
tree | b6f7011f7df982cb6c70d604beeef3c656250f7a /app/views | |
parent | ba66e0cc9cc26df686ed47d926a3edcde497baa1 (diff) |
Hides Close MR button on merged MR
When a Merge request is merged, shows only the Report abuse menu item
in the dropdown menu instead of showing the close_reopen_report toggle
with an unusable Close button.
The Report abuse is still hidden when the author of the Merge request
is the current_user.
Hides the Reopen button on a closed and locked issue when the
issue.author is not the current_user
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/shared/issuable/_close_reopen_button.html.haml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml index 70e05eb1c8c..4f6a71b6071 100644 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ b/app/views/shared/issuable/_close_reopen_button.html.haml @@ -1,16 +1,18 @@ - is_current_user = issuable_author_is_current_user(issuable) - display_issuable_type = issuable_display_type(issuable) - button_method = issuable_close_reopen_button_method(issuable) +- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false) -- if can_update - - if is_current_user +- if is_current_user + - if can_update = link_to "Close #{display_issuable_type}", close_issuable_path(issuable), method: button_method, class: "d-none d-sm-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)}", title: "Close #{display_issuable_type}" - - else - = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable - - if can_reopen && is_current_user + - if can_reopen = link_to "Reopen #{display_issuable_type}", reopen_issuable_path(issuable), method: button_method, class: "d-none d-sm-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", title: "Reopen #{display_issuable_type}" - else - = link_to 'Report abuse', new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)), - class: 'd-none d-sm-none d-md-block btn btn-grouped btn-close-color', title: 'Report abuse' + - if can_update && !are_close_and_open_buttons_hidden + = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable + - else + = link_to 'Report abuse', new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)), + class: 'd-none d-sm-none d-md-block btn btn-grouped btn-close-color', title: 'Report abuse' |