2017-08-17 22:00:37 +05:30
|
|
|
- is_collapsed = local_assigns.fetch(:is_collapsed, false)
|
2019-02-13 22:33:31 +05:30
|
|
|
- has_todo = !!issuable_sidebar.dig(:current_user, :todo, :id)
|
|
|
|
|
|
|
|
- todo_button_data = issuable_todo_button_data(issuable_sidebar, is_collapsed)
|
|
|
|
- button_title = has_todo ? todo_button_data[:mark_text] : todo_button_data[:todo_text]
|
|
|
|
- button_icon = has_todo ? todo_button_data[:mark_icon] : todo_button_data[:todo_icon]
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
%button.issuable-todo-btn.js-issuable-todo{ type: 'button',
|
2018-11-08 19:23:39 +05:30
|
|
|
class: (is_collapsed ? 'btn-blank sidebar-collapsed-icon dont-change-state has-tooltip' : 'btn btn-default issuable-header-btn float-right'),
|
2019-02-13 22:33:31 +05:30
|
|
|
title: button_title,
|
|
|
|
'aria-label' => button_title,
|
|
|
|
data: todo_button_data }
|
2017-08-17 22:00:37 +05:30
|
|
|
%span.issuable-todo-inner.js-issuable-todo-inner<
|
2019-02-13 22:33:31 +05:30
|
|
|
= is_collapsed ? button_icon : button_title
|
2017-08-17 22:00:37 +05:30
|
|
|
= icon('spin spinner', 'aria-hidden': 'true')
|