debian-mirror-gitlab/app/views/discussions/_diff_with_notes.html.haml

42 lines
2.2 KiB
Text
Raw Normal View History

2016-09-13 17:45:13 +05:30
- diff_file = discussion.diff_file
- blob = discussion.blob
2018-03-17 18:26:18 +05:30
- discussions = { discussion.original_line_code => [discussion] }
- diff_file_class = diff_file.text? ? 'text-file' : 'js-image-file'
2018-05-09 12:01:36 +05:30
- diff_data = {}
- expanded = discussion.expanded? || local_assigns.fetch(:expanded, nil)
- unless expanded
- diff_data = { lines_path: project_merge_request_discussion_path(discussion.project, discussion.noteable, discussion) }
2016-09-13 17:45:13 +05:30
2018-05-09 12:01:36 +05:30
.diff-file.file-holder.js-lazy-load-discussion{ class: diff_file_class, data: diff_data }
2017-09-10 17:25:29 +05:30
.js-file-title.file-title.file-title-flex-parent
.file-header-content
= render "projects/diffs/file_header", diff_file: diff_file, url: discussion_path(discussion), show_toggle: false
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
- if diff_file.text?
.diff-content.code.js-syntax-highlight
%table
2018-05-09 12:01:36 +05:30
- if expanded
- discussions = { discussion.original_line_code => [discussion] }
= render partial: "projects/diffs/line",
collection: discussion.truncated_diff_lines,
as: :line,
locals: { diff_file: diff_file,
discussions: discussions,
discussion_expanded: true,
plain: true }
- else
%tr.line_holder.line-holder-placeholder
%td.old_line.diff-line-num
%td.new_line.diff-line-num
%td.line_content.js-success-lazy-load
.js-code-placeholder
%td.js-error-lazy-load-diff.hidden.diff-loading-error-block
- button = button_tag(_("Try again"), class: "btn-link btn-link-retry btn-no-padding js-toggle-lazy-diff-retry-button")
= _("Unable to load the diff. %{button_try_again}").html_safe % { button_try_again: button}
= render "discussions/diff_discussion", discussions: [discussion], expanded: true
2018-03-17 18:26:18 +05:30
- else
- partial = (diff_file.new_file? || diff_file.deleted_file?) ? 'single_image_diff' : 'replaced_image_diff'
= render partial: "projects/diffs/#{partial}", locals: { diff_file: diff_file, position: discussion.position.to_json, click_to_comment: false }
.note-container
= render partial: "discussions/notes", locals: { discussion: discussion, show_toggle: false, show_image_comment_badge: true, disable_collapse_class: true }