2017-09-10 17:25:29 +05:30
|
|
|
- is_current_user = issuable_author_is_current_user(issuable)
|
|
|
|
- display_issuable_type = issuable_display_type(issuable)
|
2018-12-05 23:21:45 +05:30
|
|
|
- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false)
|
2020-05-24 23:13:21 +05:30
|
|
|
- add_blocked_class = false
|
|
|
|
- if defined? warn_before_close
|
|
|
|
- add_blocked_class = warn_before_close
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
- if is_current_user && !issuable.is_a?(MergeRequest)
|
2018-12-05 23:21:45 +05:30
|
|
|
- if can_update
|
2021-01-03 14:25:43 +05:30
|
|
|
%button{ class: "d-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)} #{(add_blocked_class ? 'btn-issue-blocked' : '')}",
|
2020-07-28 23:09:34 +05:30
|
|
|
data: { remote: 'true', endpoint: close_issuable_path(issuable), qa_selector: 'close_issue_button' } }
|
|
|
|
= _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }
|
2018-12-05 23:21:45 +05:30
|
|
|
- if can_reopen
|
2021-01-03 14:25:43 +05:30
|
|
|
%button{ class: "d-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}",
|
2020-07-28 23:09:34 +05:30
|
|
|
data: { remote: 'true', endpoint: reopen_issuable_path(issuable), qa_selector: 'reopen_issue_button' } }
|
|
|
|
= _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type }
|
2018-03-17 18:26:18 +05:30
|
|
|
- else
|
2018-12-05 23:21:45 +05:30
|
|
|
- if can_update && !are_close_and_open_buttons_hidden
|
2021-01-03 14:25:43 +05:30
|
|
|
- if issuable.is_a?(MergeRequest)
|
|
|
|
= render 'shared/issuable/close_reopen_draft_report_toggle', issuable: issuable
|
|
|
|
- else
|
|
|
|
= render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class
|
2018-12-05 23:21:45 +05:30
|
|
|
- else
|
2021-01-29 00:20:46 +05:30
|
|
|
- unless issuable.is_a?(MergeRequest) && issuable.merged?
|
|
|
|
= link_to _('Report abuse'), new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)),
|
|
|
|
class: 'd-none d-md-block btn btn-grouped btn-close-color', title: _('Report abuse')
|