summaryrefslogtreecommitdiff
path: root/app/views/projects/notes/_discussion.html.haml
blob: 7869d6413d8d877d93b2776e263c452b5e5e84e0 (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
- note = discussion_notes.first
- expanded = !note.diff_note? || note.active?
%li.note.note-discussion.timeline-entry
  .timeline-entry-inner
    .timeline-icon
      = link_to user_path(note.author) do
        = image_tag avatar_icon(note.author), class: "avatar s40"
    .timeline-content
      .discussion.js-toggle-container{ class: note.discussion_id }
        .discussion-header
          = link_to_member(@project, note.author, avatar: false)

          .inline.discussion-headline-light
            = note.author.to_reference
            started a discussion on

            - if note.for_commit?
              - commit = note.noteable
              - if commit
                commit
                = link_to commit.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code), class: 'monospace'
              - else
                a deleted commit
            - else
              - if note.active?
                = link_to diffs_namespace_project_merge_request_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) do
                  the diff
              - else
                an outdated diff

            = time_ago_with_tooltip(note.created_at, placement: "bottom", html_class: "note-created-ago")

          .discussion-actions
            = link_to "#", class: "note-action-button discussion-toggle-button js-toggle-button" do
              - if expanded
                = icon("chevron-up")
              - else
                = icon("chevron-down")

              Toggle discussion

        .discussion-body.js-toggle-content{ class: ("hide" unless expanded) }
          - if note.diff_note?
            = render "projects/notes/discussions/diff_with_notes", discussion_notes: discussion_notes
          - else
            = render "projects/notes/discussions/notes", discussion_notes: discussion_notes