2017-07-06 14:35:07 +00:00
|
|
|
- display_issuable_type = issuable_display_type(issuable)
|
2017-06-07 10:18:35 +00:00
|
|
|
- button_action = issuable.closed? ? 'reopen' : 'close'
|
|
|
|
- display_button_action = button_action.capitalize
|
2018-04-09 21:36:25 +00:00
|
|
|
- button_responsive_class = 'd-none d-sm-none d-md-block'
|
2017-07-17 17:12:55 +00:00
|
|
|
- button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button js-btn-issue-action issuable-close-button"
|
2017-06-07 10:18:35 +00:00
|
|
|
- toggle_class = "#{button_responsive_class} btn btn-nr dropdown-toggle js-issuable-close-toggle"
|
2017-07-04 13:41:26 +00:00
|
|
|
- button_method = issuable_close_reopen_button_method(issuable)
|
2020-04-21 15:21:10 +00:00
|
|
|
- add_blocked_class = false
|
|
|
|
- if defined? warn_before_close
|
|
|
|
- add_blocked_class = !issuable.closed? && warn_before_close
|
2017-06-07 10:18:35 +00:00
|
|
|
|
2018-04-09 17:36:21 +00:00
|
|
|
.float-left.btn-group.prepend-left-10.issuable-close-dropdown.droplab-dropdown.js-issuable-close-dropdown
|
2017-09-28 11:37:29 +00:00
|
|
|
= link_to "#{display_button_action} #{display_issuable_type}", close_reopen_issuable_path(issuable),
|
2020-05-29 06:08:16 +00:00
|
|
|
method: button_method, class: "#{button_class} btn-#{button_action} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", title: "#{display_button_action} #{display_issuable_type}", data: { qa_selector: 'close_issue_button' }
|
2017-06-07 10:18:35 +00:00
|
|
|
|
2017-07-04 13:41:26 +00:00
|
|
|
= button_tag type: 'button', class: "#{toggle_class} btn-#{button_action}-color",
|
2020-05-15 09:07:59 +00:00
|
|
|
data: { 'dropdown-trigger' => '#issuable-close-menu' }, 'aria-label' => _('Toggle dropdown') do
|
2017-06-07 13:17:03 +00:00
|
|
|
= icon('caret-down', class: 'toggle-icon icon')
|
2017-06-07 10:18:35 +00:00
|
|
|
|
2018-04-18 16:54:19 +00:00
|
|
|
%ul#issuable-close-menu.js-issuable-close-menu.dropdown-menu{ data: { dropdown: true } }
|
2017-07-04 13:41:26 +00:00
|
|
|
%li.close-item{ class: "#{issuable_button_visibility(issuable, true) || 'droplab-item-selected'}",
|
2020-05-15 09:07:59 +00:00
|
|
|
data: { text: _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: close_issuable_path(issuable),
|
2017-07-04 13:41:26 +00:00
|
|
|
button_class: "#{button_class} btn-close", toggle_class: "#{toggle_class} btn-close-color", method: button_method } }
|
2017-06-07 13:17:03 +00:00
|
|
|
%button.btn.btn-transparent
|
|
|
|
= icon('check', class: 'icon')
|
2017-06-07 10:18:35 +00:00
|
|
|
.description
|
2017-07-07 13:51:34 +00:00
|
|
|
%strong.title
|
2020-05-15 09:07:59 +00:00
|
|
|
= _('Close')
|
2017-06-07 10:18:35 +00:00
|
|
|
= display_issuable_type
|
|
|
|
|
2017-07-04 13:41:26 +00:00
|
|
|
%li.reopen-item{ class: "#{issuable_button_visibility(issuable, false) || 'droplab-item-selected'}",
|
2020-05-15 09:07:59 +00:00
|
|
|
data: { text: _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: reopen_issuable_path(issuable),
|
2017-07-04 13:41:26 +00:00
|
|
|
button_class: "#{button_class} btn-reopen", toggle_class: "#{toggle_class} btn-reopen-color", method: button_method } }
|
2017-06-07 13:17:03 +00:00
|
|
|
%button.btn.btn-transparent
|
|
|
|
= icon('check', class: 'icon')
|
2017-06-07 10:18:35 +00:00
|
|
|
.description
|
2017-07-07 13:51:34 +00:00
|
|
|
%strong.title
|
2020-05-15 09:07:59 +00:00
|
|
|
= _('Reopen')
|
2017-06-07 10:18:35 +00:00
|
|
|
= display_issuable_type
|
|
|
|
|
2017-07-03 16:00:59 +00:00
|
|
|
%li.divider.droplab-item-ignore
|
2017-06-07 10:18:35 +00:00
|
|
|
|
2020-05-15 09:07:59 +00:00
|
|
|
%li.report-item{ data: { text: _('Report abuse'), url: new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)),
|
2017-09-05 14:25:40 +00:00
|
|
|
button_class: "#{button_class} btn-close-color", toggle_class: "#{toggle_class} btn-close-color", method: '' } }
|
|
|
|
%button.btn.btn-transparent
|
|
|
|
= icon('check', class: 'icon')
|
|
|
|
.description
|
2020-05-18 21:08:42 +00:00
|
|
|
%strong.title= _('Report abuse')
|
2017-09-05 14:25:40 +00:00
|
|
|
%p.text
|
2020-05-15 09:07:59 +00:00
|
|
|
= _('Report %{display_issuable_type} that are abusive, inappropriate or spam.') % { display_issuable_type: display_issuable_type.pluralize }
|