summaryrefslogtreecommitdiff
path: root/app/views/dashboard/todos/_todo.html.haml
blob: f97c0e2b9b64827fc2ab3aa83d45b2211aa6f8a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%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-secondary

        = 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
            = link_to todo_target_name(todo), todo_target_path(todo), class: 'todo-target-link gl-text-secondary! gl-text-decoration-none!', :'aria-describedby' => dom_id(todo) + "_describer", :'aria-label' => todo_target_aria_label(todo)
          - else
            = _("(removed)")

      .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.note.present?
                \:

          %span.action-name{ data: { qa_selector: "todo_action_name_content" } }<
            - if !todo.note.present?
              = todo_action_name(todo)
              - unless todo.self_assigned?
                \.

          - if todo.self_assigned?
            %span.action-name<
              = todo_self_addressing(todo)
              \.
          - if todo.note.present?
            %span.action-description<
            = first_line_in_markdown(todo, :body, 125, is_todo: true, project: todo.project, group: todo.group)

    .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-secondary
        = todo_due_date(todo)
        #{time_ago_with_tooltip(todo.created_at)}


    .todo-actions.gl-mr-4.gl-px-2.gl-sm-px-0.gl-sm-mx-0
      - if todo.pending?
        = 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)
          = 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)
          = sprite_icon('redo', css_class: 'js-todo-button-icon')
      - else
        = 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)
          = sprite_icon('todo-add', css_class: 'js-todo-button-icon')