_discussion.html.haml 2.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
- note = discussion_notes.first
.discussion.js-details-container.js-toggler-container.open{ class: note.discussion_id }
  .discussion-header
    .discussion-actions
      = link_to "javascript:;", class: "js-details-target turn-on js-toggler-target" do
        %i.icon-eye-close
        Hide discussion
      = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do
        %i.icon-eye-open
        Show discussion
11
    = image_tag avatar_icon(note.author_email), class: "avatar s32"
12
    %div
13
      = link_to_member(@project, note.author, avatar: false)
14
      - if note.for_merge_request?
15 16 17 18 19 20 21 22 23
        - if note.diff
          started a discussion on this merge request diff
          = link_to_merge_request_diff_line_note(note)
        - else
          started
          %strong
            %i.icon-remove
            outdated
          discussion on this merge request diff
24 25
      - elsif note.for_commit?
        started a discussion on commit
Izaak Alpert's avatar
Izaak Alpert committed
26
        #{link_to note.noteable.short_id, project_commit_path(note.project, note.noteable)}
27 28 29 30
        = link_to_commit_diff_line_note(note) if note.for_diff_line?
      - else
        %cite.cgray started a discussion
    %div
Riyad Preukschas's avatar
Riyad Preukschas committed
31 32
      - last_note = discussion_notes.last
      last updated by
33
      = link_to_member(@project, last_note.author, avatar: false)
Riyad Preukschas's avatar
Riyad Preukschas committed
34
      %span.discussion-last-update
35
        #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
36 37
  .discussion-body
    - if note.for_diff_line?
38
      - if note.active?
39
        = render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note
40 41 42
      - else
        = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion'
        %div.hide.outdated-discussion
43 44
          .notes{ rel: discussion_notes.first.discussion_id }
            = render discussion_notes
45

46
    - else
47 48 49
      .notes{ rel: discussion_notes.first.discussion_id }
        = render discussion_notes
      = render "projects/notes/discussion_reply_button", note: discussion_notes.first
50 51 52 53 54 55 56 57

    -# will be shown when the other one is hidden
    .discussion-hidden.content.hide
      .note
        %em Hidden discussion.
        = link_to "javascript:;", class: "js-details-target js-toggler-target" do
          %i.icon-eye-open
          Show