2016-02-05 16:20:29 +00:00
|
|
|
- snippet_blob = chunk_snippet(snippet_blob, @search_term)
|
|
|
|
- snippet = snippet_blob[:snippet_object]
|
|
|
|
- snippet_chunks = snippet_blob[:snippet_chunks]
|
|
|
|
|
2014-08-29 19:22:45 +00:00
|
|
|
.search-result-row
|
|
|
|
%span
|
2016-02-05 16:20:29 +00:00
|
|
|
= snippet.title
|
2014-08-29 19:22:45 +00:00
|
|
|
by
|
2016-02-05 16:20:29 +00:00
|
|
|
= link_to user_snippets_path(snippet.author) do
|
2017-02-15 10:42:54 +00:00
|
|
|
= image_tag avatar_icon(snippet.author), class: "avatar avatar-inline s16", alt: ''
|
2016-02-05 16:20:29 +00:00
|
|
|
= snippet.author_name
|
2017-01-13 16:07:21 +00:00
|
|
|
%span.light= time_ago_with_tooltip(snippet.created_at)
|
2014-08-29 19:22:45 +00:00
|
|
|
%h4.snippet-title
|
2016-02-05 16:20:29 +00:00
|
|
|
- snippet_path = reliable_snippet_path(snippet)
|
2017-02-14 14:08:20 +00:00
|
|
|
.file-holder
|
|
|
|
.js-file-title.file-title
|
|
|
|
= link_to snippet_path do
|
2014-10-01 22:21:29 +00:00
|
|
|
%i.fa.fa-file
|
2016-02-05 16:20:29 +00:00
|
|
|
%strong= snippet.file_name
|
2017-02-14 14:08:20 +00:00
|
|
|
- if markup?(snippet.file_name)
|
|
|
|
.file-content.wiki
|
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
|
|
|
= render_markup(snippet.file_name, chunk[:data])
|
|
|
|
- else
|
|
|
|
.file-content.code
|
|
|
|
.nothing-here-block Empty file
|
|
|
|
- else
|
|
|
|
.file-content.code.js-syntax-highlight
|
|
|
|
.line-numbers
|
2016-02-05 16:20:29 +00:00
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
2017-02-14 14:08:20 +00:00
|
|
|
- Gitlab::Git::Util.count_lines(chunk[:data]).times do |index|
|
|
|
|
- offset = defined?(chunk[:start_line]) ? chunk[:start_line] : 1
|
|
|
|
- i = index + offset
|
|
|
|
= link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}", class: "diff-line-num" do
|
|
|
|
%i.fa.fa-link
|
|
|
|
= i
|
|
|
|
.blob-content
|
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
|
|
|
= highlight(snippet.file_name, chunk[:data], repository: nil, plain: snippet.no_highlighting?)
|
2014-08-29 19:22:45 +00:00
|
|
|
- else
|
|
|
|
.file-content.code
|
|
|
|
.nothing-here-block Empty file
|