summaryrefslogtreecommitdiff
path: root/app/views/discussions/_discussion.html.haml
blob: e9589213f807c72e063c7eda909f39ca76328b54 (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
- expanded = discussion.expanded?
%li.note.note-discussion.timeline-entry
  .timeline-entry-inner
    .timeline-icon
      = link_to user_path(discussion.author) do
        = image_tag avatar_icon_for_user(discussion.author), class: "avatar s40"
    .timeline-content
      .discussion.js-toggle-container{ data: { discussion_id: discussion.id } }
        .discussion-header
          .discussion-actions
            %button.note-action-button.discussion-toggle-button.js-toggle-button{ type: "button", class: ("js-toggle-lazy-diff" unless expanded) }
              - if expanded
                = icon("chevron-up")
              - else
                = icon("chevron-down")
              Toggle discussion
          = link_to_member(@project, discussion.author, avatar: false)

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

            - url = discussion_path(discussion)
            - if discussion.for_commit? && @noteable != discussion.noteable
              on
              - commit = discussion.noteable
              - if commit
                commit
                = link_to commit.short_id, url, class: 'commit-sha'
              - else
                a deleted commit
            - elsif discussion.diff_discussion?
              on
              = conditional_link_to url.present?, url do
                - if discussion.on_merge_request_commit?
                  - unless discussion.active?
                    an outdated change in
                  commit

                  %span.commit-sha= Commit.truncate_sha(discussion.commit_id)
                - else
                  - unless discussion.active?
                    an old version of
                  the diff


            = time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago")
          = render "discussions/headline", discussion: discussion

        .discussion-body.js-toggle-content{ class: ("hide" unless expanded) }
          - if discussion.diff_discussion? && discussion.diff_file
            = render "discussions/diff_with_notes", discussion: discussion
          - else
            .panel.panel-default
              = render partial: "discussions/notes", locals: { discussion: discussion, disable_collapse_class: true }