debian-mirror-gitlab/app/views/search/results/_blob_highlight.html.haml

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

29 lines
1.5 KiB
Text
Raw Normal View History

2022-01-26 12:08:38 +05:30
- offset = defined?(first_line_number) ? first_line_number : 1
- highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil
#search-blob-content.file-content.code.js-syntax-highlight{ class: 'gl-py-3!' }
- if blob.present?
.blob-content{ data: { blob_id: blob.id, path: blob.path, highlight_line: highlight, qa_selector: 'file_content' } }
- blob.present.highlight.lines.each_with_index do |line, index|
- i = index + offset
2022-06-21 17:19:12 +05:30
.line_holder.code-search-line.gl-display-flex
2022-01-26 12:08:38 +05:30
.line-numbers
.gl-display-flex
%span.diff-line-num.gl-pl-3
2022-05-07 20:08:51 +05:30
%a.has-tooltip{ href: "#{blame_link}#L#{i}",
id: "blame-L#{i}",
data: { "line_number" => i,
"track_action" => 'click_link',
"track_label" => 'git_blame',
"track_property" => 'search_result' },
title: _('View blame') }
2022-01-26 12:08:38 +05:30
= sprite_icon('git')
%span.diff-line-num.flex-grow-1.gl-pr-3
%a{ href: "#{blob_link}#L#{i}", id: "blob-L#{i}", 'data-line-number' => i, class: 'gl-display-flex! gl-align-items-center gl-justify-content-end' }
= sprite_icon('link', css_class: 'gl-ml-3! gl-mr-1!')
= i
2022-06-21 17:19:12 +05:30
%pre.code.highlight.flex-grow-1
2022-01-26 12:08:38 +05:30
%code
= line.html_safe