2017-07-06 14:35:07 +00:00
|
|
|
- is_current_user = issuable_author_is_current_user(issuable)
|
|
|
|
- display_issuable_type = issuable_display_type(issuable)
|
2017-07-04 13:41:26 +00:00
|
|
|
- button_method = issuable_close_reopen_button_method(issuable)
|
2018-09-20 14:41:15 +00:00
|
|
|
- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false)
|
2020-04-21 15:21:10 +00:00
|
|
|
- add_blocked_class = false
|
|
|
|
- if defined? warn_before_close
|
|
|
|
- add_blocked_class = warn_before_close
|
2017-07-03 16:00:59 +00:00
|
|
|
|
2018-09-20 14:41:15 +00:00
|
|
|
- if is_current_user
|
|
|
|
- if can_update
|
2020-05-15 09:07:59 +00:00
|
|
|
= link_to _("Close %{display_issuable_type}") % { display_issuable_type: 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)} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", title: _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, data: { qa_selector: 'close_issue_button' }
|
2018-09-20 14:41:15 +00:00
|
|
|
- if can_reopen
|
2020-05-15 09:07:59 +00:00
|
|
|
= link_to _("Reopen %{display_issuable_type}") % { display_issuable_type: 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}") % { display_issuable_type: display_issuable_type }, data: { qa_selector: 'reopen_issue_button' }
|
2017-09-05 14:25:40 +00:00
|
|
|
- else
|
2018-09-20 14:41:15 +00:00
|
|
|
- if can_update && !are_close_and_open_buttons_hidden
|
2020-04-21 15:21:10 +00:00
|
|
|
= render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class
|
2018-09-20 14:41:15 +00:00
|
|
|
- else
|
2020-05-15 09:07:59 +00:00
|
|
|
= 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')
|