debian-mirror-gitlab/app/views/projects/diffs/_text_file.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
2.5 KiB
Text
Raw Normal View History

2022-01-26 12:08:38 +05:30
- too_big = diff_file.diff_lines.count > Commit.diff_safe_max_lines
2015-04-26 12:48:37 +05:30
- if too_big
2015-09-11 14:41:01 +05:30
.suppressed-container
2019-07-31 22:56:46 +05:30
%a.show-suppressed-diff.cursor-pointer.js-show-suppressed-diff= _("Changes suppressed. Click to show.")
2015-04-26 12:48:37 +05:30
2019-09-04 21:01:54 +05:30
%table.text-file.diff-wrap-lines.code.code-commit.js-syntax-highlight.commit-diff{ data: diff_view_data, class: too_big ? 'hide' : '' }
2022-03-02 08:16:31 +05:30
- if Feature.enabled?(:inline_haml_diff_line_rendering, @project, default_enabled: :yaml)
- diff_file.highlighted_diff_lines.each do |line|
- line_code = diff_file.line_code(line)
%tr.line_holder{ class: line.type, id: line_code }
- case line.type
- when 'match'
= diff_match_line line.old_pos, line.new_pos, text: line.text
2022-06-21 17:19:12 +05:30
- when 'old-nomappinginraw', 'new-nomappinginraw', 'unchanged-nomappinginraw'
= diff_nomappinginraw_line line, %w[old_line diff-line-num], %w[new_line diff-line-num], %w[line_content]
2022-03-02 08:16:31 +05:30
- when 'old-nonewline', 'new-nonewline'
%td.old_line.diff-line-num
%td.new_line.diff-line-num
%td.line_content.match= line.text
- else
%td.old_line.diff-line-num{ class: "#{line.type} js-avatar-container", data: { linenumber: line.old_pos } }
= add_diff_note_button(line_code, diff_file.position(line), line.type)
%a{ href: "##{line_code}", data: { linenumber: diff_link_number(line.type, "new", line.old_pos) } }
%td.new_line.diff-line-num{ class: line.type, data: { linenumber: line.new_pos } }
%a{ href: "##{line_code}", data: { linenumber: diff_link_number(line.type, "old", line.new_pos) } }
%td.line_content{ class: line.type }<
= diff_line_content(line.rich_text)
- if line.discussable? && @grouped_diff_discussions.present? && @grouped_diff_discussions[line_code]
- line_discussions = @grouped_diff_discussions[line_code]
= render "discussions/diff_discussion", discussions: line_discussions, expanded: line_discussions.any?(&:expanded?)
- else
= render partial: "projects/diffs/line",
collection: diff_file.highlighted_diff_lines,
as: :line,
locals: { diff_file: diff_file, discussions: @grouped_diff_discussions }
2015-04-26 12:48:37 +05:30
2017-09-10 17:25:29 +05:30
- if !diff_file.new_file? && !diff_file.deleted_file? && diff_file.highlighted_diff_lines.any?
2017-08-17 22:00:37 +05:30
- last_line = diff_file.highlighted_diff_lines.last
- if last_line.new_pos < total_lines
%tr.line_holder
= diff_match_line last_line.old_pos, last_line.new_pos, bottom: true