debian-mirror-gitlab/app/views/shared/issuable/_close_reopen_button.html.haml

19 lines
1.4 KiB
Text
Raw Normal View History

2017-09-10 17:25:29 +05:30
- is_current_user = issuable_author_is_current_user(issuable)
- display_issuable_type = issuable_display_type(issuable)
- button_method = issuable_close_reopen_button_method(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)
2017-09-10 17:25:29 +05:30
2018-12-05 23:21:45 +05:30
- if is_current_user
- if can_update
2018-11-20 20:47:30 +05:30
= link_to "Close #{display_issuable_type}", close_issuable_path(issuable), method: button_method,
2020-01-01 13:55:28 +05:30
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}", data: { qa_selector: 'close_issue_button' }
2018-12-05 23:21:45 +05:30
- if can_reopen
2018-11-20 20:47:30 +05:30
= link_to "Reopen #{display_issuable_type}", reopen_issuable_path(issuable), method: button_method,
2019-12-04 20:38:33 +05:30
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}", data: { qa_selector: 'reopen_issue_button' }
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
= 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'