22 lines
1.5 KiB
Text
22 lines
1.5 KiB
Text
- is_current_user = issuable_author_is_current_user(issuable)
|
|
- display_issuable_type = issuable_display_type(issuable)
|
|
- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false)
|
|
- add_blocked_class = false
|
|
- if defined? warn_before_close
|
|
- add_blocked_class = warn_before_close
|
|
|
|
- if is_current_user
|
|
- if can_update
|
|
%button{ class: "d-none d-sm-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)} #{(add_blocked_class ? 'btn-issue-blocked' : '')}",
|
|
data: { remote: 'true', endpoint: close_issuable_path(issuable), qa_selector: 'close_issue_button' } }
|
|
= _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }
|
|
- if can_reopen
|
|
%button{ class: "d-none d-sm-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}",
|
|
data: { remote: 'true', endpoint: reopen_issuable_path(issuable), qa_selector: 'reopen_issue_button' } }
|
|
= _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type }
|
|
- else
|
|
- if can_update && !are_close_and_open_buttons_hidden
|
|
= render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class
|
|
- 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')
|