diff --git a/app/views/discussions/_diff_discussion.html.haml b/app/views/discussions/_diff_discussion.html.haml index c280b5b53b7..1411daeb4a6 100644 --- a/app/views/discussions/_diff_discussion.html.haml +++ b/app/views/discussions/_diff_discussion.html.haml @@ -1,4 +1,4 @@ -- expanded = local_assigns.fetch(:expanded, discussion.expanded?) +- expanded = local_assigns.fetch(:expanded, true) %tr.notes_holder{class: ('hide' unless expanded)} %td.notes_line{ colspan: 2 } %td.notes_content diff --git a/app/views/projects/diffs/_line.html.haml b/app/views/projects/diffs/_line.html.haml index 4082f7bba20..7042e9f1fc9 100644 --- a/app/views/projects/diffs/_line.html.haml +++ b/app/views/projects/diffs/_line.html.haml @@ -30,8 +30,8 @@ = diff_line_content(line.text, type) - discussions = local_assigns.fetch(:discussions, nil) -- discussion_expanded = local_assigns.fetch(:discussion_expanded, false) - if discussions && !line.meta? - discussion = discussions[line_code] - if discussion + - discussion_expanded = local_assigns.fetch(:discussion_expanded, discussion.expanded?) = render "discussions/diff_discussion", discussion: discussion, expanded: discussion_expanded diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index da8e343a121..f1d2d4bf268 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -9,9 +9,7 @@ = render partial: "projects/diffs/line", collection: diff_file.highlighted_diff_lines, as: :line, - locals: { diff_file: diff_file, - discussions: discussions, - plain: true } + locals: { diff_file: diff_file, discussions: discussions } - last_line = diff_file.highlighted_diff_lines.last.new_pos - if !diff_file.new_file && last_line > 0