diff options
Diffstat (limited to 'app/views/dashboard/todos/_todo.html.haml')
-rw-r--r-- | app/views/dashboard/todos/_todo.html.haml | 98 |
1 files changed, 52 insertions, 46 deletions
diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml index 47bc8f5c95b..9dfeaa3d07d 100644 --- a/app/views/dashboard/todos/_todo.html.haml +++ b/app/views/dashboard/todos/_todo.html.haml @@ -1,60 +1,66 @@ -%li.todo.gl-hover-border-blue-200.gl-hover-bg-blue-50.gl-hover-cursor-pointer{ class: "todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo), data: { url: todo_target_path(todo) } } - .gl-display-flex.gl-flex-direction-row - .todo-avatar.gl-display-none.gl-sm-display-inline-block - = author_avatar(todo, size: 40) - - .todo-item.flex-fill.gl-overflow-hidden.gl-overflow-x-auto.gl-align-self-center{ data: { qa_selector: "todo_item_container" } } - .todo-title.gl-mb-3.gl-md-mb-0 - - if todo_author_display?(todo) - = todo_target_state_pill(todo) - - %span.title-item.author-name.bold - - if todo.author - = link_to_author(todo, self_added: todo.self_added?) - - else - = _('(removed)') - - %span.title-item.action-name{ data: { qa_selector: "todo_action_name_content" } } - = todo_action_name(todo) - - %span.title-item.todo-label.todo-target-link +%li.todo.gl-hover-border-blue-200.gl-hover-bg-blue-50.gl-hover-cursor-pointer.gl-relative{ class: "todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo) } + .gl-display-flex.gl-flex-direction-column.gl-sm-flex-direction-row.gl-sm-align-items-center + .todo-item.gl-overflow-hidden.gl-overflow-x-auto.gl-align-self-center.gl-w-full{ data: { qa_selector: "todo_item_container" } } + .todo-title.gl-pt-2.gl-pb-3.gl-px-2.gl-md-mb-1.gl-font-sm.gl-text-gray-500 + + = todo_target_state_pill(todo) + + %span.todo-target-title{ data: { qa_selector: "todo_target_title_content" }, :id => dom_id(todo) + "_describer" } + = todo_target_title(todo) + + - if !todo.for_design? && !todo.member_access_requested? + · + + %span + = todo_parent_path(todo) + + %span.todo-label - if todo.target - = todo_target_link(todo) + = link_to todo_target_name(todo), todo_target_path(todo), class: 'todo-target-link gl-text-gray-500! gl-text-decoration-none!', :'aria-describedby' => dom_id(todo) + "_describer", :'aria-label' => todo_target_aria_label(todo) - else = _("(removed)") - %span.title-item.todo-target-title{ data: { qa_selector: "todo_target_title_content" } } - = todo_target_title(todo) - - %span.title-item.todo-project.todo-label - = s_('Todo|at %{todo_parent_path}').html_safe % { todo_parent_path: todo_parent_path(todo) } + .todo-body.gl-mb-2.gl-px-2.gl-display-flex.gl-align-items-flex-start.gl-lg-align-items-center + .todo-avatar.gl-display-none.gl-sm-display-inline-block + = author_avatar(todo, size: 24) + .todo-note + - if todo_author_display?(todo) + .author-name.bold.gl-display-inline + - if todo.author + = link_to_author(todo, self_added: todo.self_added?) + - else + = _('(removed)') - - if todo.self_assigned? - %span.title-item.action-name - = todo_self_addressing(todo) + %span.action-name{ data: { qa_selector: "todo_action_name_content" } }< + = todo_action_name(todo) + - if todo.note.present? + \: + - unless todo.note.present? || todo.self_assigned? + \. - %span.title-item - · + - if todo.self_assigned? + %span.action-name< + = todo_self_addressing(todo) + \. + - if todo.note.present? + %span.action-description.gl-font-style-italic< + = first_line_in_markdown(todo, :body, 100, is_todo: true, project: todo.project, group: todo.group) - %span.title-item.todo-timestamp - #{time_ago_with_tooltip(todo.created_at)} - = todo_due_date(todo) + .todo-timestamp.gl-white-space-nowrap.gl-sm-ml-3.gl-mt-2.gl-mb-2.gl-sm-my-0.gl-px-2.gl-sm-px-0 + %span.todo-timestamp.gl-font-sm.gl-text-gray-500 + = todo_due_date(todo) + #{time_ago_with_tooltip(todo.created_at)} - - if todo.note.present? - .todo-body - .todo-note.break-word - .md - = first_line_in_markdown(todo, :body, 150, project: todo.project, group: todo.group) - .todo-actions.gl-ml-3 + .todo-actions.gl-mr-4.gl-px-2.gl-sm-px-0.gl-sm-mx-0 - if todo.pending? - = link_to dashboard_todo_path(todo), method: :delete, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-done-todo', data: { href: dashboard_todo_path(todo) } do + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-done-todo has-tooltip', title: _('Mark as done')}, method: :delete, href: dashboard_todo_path(todo)), 'aria-label' => _('Mark as done') do = gl_loading_icon(inline: true) - = _('Done') - = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-undo-todo hidden', data: { href: restore_dashboard_todo_path(todo) } do + = sprite_icon('check', css_class: 'js-todo-button-icon') + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-undo-todo hidden has-tooltip', title: _('Undo')}, method: :patch, href: restore_dashboard_todo_path(todo)), 'aria-label' => _('Undo') do = gl_loading_icon(inline: true) - = _('Undo') + = sprite_icon('redo', css_class: 'js-todo-button-icon') - else - = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-add-todo has-tooltip', title: _('Add a to do')}, method: :patch, href: restore_dashboard_todo_path(todo)), 'aria-label' => _('Add a to do') do = gl_loading_icon(inline: true) - = _('Add a to do') + = sprite_icon('todo-add', css_class: 'js-todo-button-icon') |