2017-08-17 22:00:37 +05:30
|
|
|
- is_collapsed = local_assigns.fetch(:is_collapsed, false)
|
2019-02-15 15:39:39 +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',
|
2021-03-11 19:13:27 +05:30
|
|
|
class: (is_collapsed ? 'btn-blank sidebar-collapsed-icon dont-change-state has-tooltip' : 'gl-button btn btn-default issuable-header-btn float-right'),
|
2019-02-15 15:39:39 +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-15 15:39:39 +05:30
|
|
|
= is_collapsed ? button_icon : button_title
|
2021-03-11 19:13:27 +05:30
|
|
|
= loading_icon(css_class: is_collapsed ? '' : 'gl-ml-3')
|