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

41 lines
1.7 KiB
Text
Raw Normal View History

2022-03-02 08:16:31 +05:30
-# This file is deprecated in favour of inline rendering:
-# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57237
2016-08-24 12:49:21 +05:30
- plain = local_assigns.fetch(:plain, false)
2017-08-17 22:00:37 +05:30
- discussions = local_assigns.fetch(:discussions, nil)
2016-09-13 17:45:13 +05:30
- line_code = diff_file.line_code(line)
2022-05-07 20:08:51 +05:30
- if discussions
2017-08-17 22:00:37 +05:30
- line_discussions = discussions[line_code]
2021-01-29 00:20:46 +05:30
%tr.line_holder{ class: line.type, id: (line_code unless plain) }
- case line.type
2016-06-02 11:05:42 +05:30
- when 'match'
2016-09-13 17:45:13 +05:30
= diff_match_line line.old_pos, line.new_pos, text: line.text
2017-08-17 22:00:37 +05:30
- when 'old-nonewline', 'new-nonewline'
2016-06-02 11:05:42 +05:30
%td.old_line.diff-line-num
%td.new_line.diff-line-num
%td.line_content.match= line.text
- else
2022-05-07 20:08:51 +05:30
%td.old_line.diff-line-num{ class: [line.type, ("js-avatar-container" unless plain)], data: { linenumber: line.old_pos } }
2016-08-24 12:49:21 +05:30
- if plain
2021-01-29 00:20:46 +05:30
= diff_link_number(line.type, "new", line.old_pos)
2016-06-02 11:05:42 +05:30
- else
2022-05-07 20:08:51 +05:30
- if line.discussable?
= add_diff_note_button(line_code, diff_file.position(line), line.type)
2021-01-29 00:20:46 +05:30
%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 } }
2016-08-24 12:49:21 +05:30
- if plain
2021-01-29 00:20:46 +05:30
= diff_link_number(line.type, "old", line.new_pos)
2016-06-02 11:05:42 +05:30
- else
2021-01-29 00:20:46 +05:30
%a{ href: "##{line_code}", data: { linenumber: diff_link_number(line.type, "old", line.new_pos) } }
%td.line_content{ class: line.type }<
- if local_assigns.fetch(:email, false)
2018-11-08 19:23:39 +05:30
%pre= line.rich_text
2016-09-13 17:45:13 +05:30
- else
2018-11-08 19:23:39 +05:30
= diff_line_content(line.rich_text)
2016-09-13 17:45:13 +05:30
2017-08-17 22:00:37 +05:30
- if line_discussions&.any?
- discussion_expanded = local_assigns.fetch(:discussion_expanded, line_discussions.any?(&:expanded?))
= render "discussions/diff_discussion", discussions: line_discussions, expanded: discussion_expanded