2017-03-24 12:17:38 -04:00
|
|
|
- is_collapsed = local_assigns.fetch(:is_collapsed, false)
|
2018-04-19 10:43:20 -04:00
|
|
|
- mark_content = is_collapsed ? icon('check-square', class: 'todo-undone') : _('Mark todo as done')
|
2018-01-23 02:03:01 -05:00
|
|
|
- todo_content = is_collapsed ? icon('plus-square') : _('Add todo')
|
2017-03-24 12:17:38 -04:00
|
|
|
|
|
|
|
%button.issuable-todo-btn.js-issuable-todo{ type: 'button',
|
2018-05-10 15:22:56 -04:00
|
|
|
class: (is_collapsed ? 'btn-blank sidebar-collapsed-icon dont-change-state has-tooltip' : 'btn btn-default issuable-header-btn float-right'),
|
2018-04-19 10:43:20 -04:00
|
|
|
title: (todo.nil? ? _('Add todo') : _('Mark todo as done')),
|
|
|
|
'aria-label' => (todo.nil? ? _('Add todo') : _('Mark todo as done')),
|
2017-03-24 12:17:38 -04:00
|
|
|
data: issuable_todo_button_data(issuable, todo, is_collapsed) }
|
|
|
|
%span.issuable-todo-inner.js-issuable-todo-inner<
|
|
|
|
- if todo
|
|
|
|
= mark_content
|
|
|
|
- else
|
|
|
|
= todo_content
|
|
|
|
= icon('spin spinner', 'aria-hidden': 'true')
|