2016-02-05 11:20:29 -05:00
|
|
|
- snippet_blob = chunk_snippet(snippet_blob, @search_term)
|
|
|
|
- snippet = snippet_blob[:snippet_object]
|
|
|
|
- snippet_chunks = snippet_blob[:snippet_chunks]
|
|
|
|
|
2014-08-29 15:22:45 -04:00
|
|
|
.search-result-row
|
|
|
|
%span
|
2016-02-05 11:20:29 -05:00
|
|
|
= snippet.title
|
2014-08-29 15:22:45 -04:00
|
|
|
by
|
2016-02-05 11:20:29 -05:00
|
|
|
= link_to user_snippets_path(snippet.author) do
|
|
|
|
= image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
|
|
|
|
= snippet.author_name
|
2017-01-13 11:07:21 -05:00
|
|
|
%span.light= time_ago_with_tooltip(snippet.created_at)
|
2014-08-29 15:22:45 -04:00
|
|
|
%h4.snippet-title
|
2016-02-05 11:20:29 -05:00
|
|
|
- snippet_path = reliable_snippet_path(snippet)
|
2014-08-29 15:22:45 -04:00
|
|
|
= link_to snippet_path do
|
|
|
|
.file-holder
|
2017-02-05 17:28:48 -05:00
|
|
|
.js-file-title.file-title
|
2014-10-01 18:21:29 -04:00
|
|
|
%i.fa.fa-file
|
2016-02-05 11:20:29 -05:00
|
|
|
%strong= snippet.file_name
|
|
|
|
- if markup?(snippet.file_name)
|
2014-08-29 15:22:45 -04:00
|
|
|
.file-content.wiki
|
2016-02-05 11:20:29 -05:00
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
|
|
|
= render_markup(snippet.file_name, chunk[:data])
|
2014-08-29 15:22:45 -04:00
|
|
|
- else
|
|
|
|
.file-content.code
|
|
|
|
.nothing-here-block Empty file
|
|
|
|
- else
|
2016-01-21 08:23:53 -05:00
|
|
|
.file-content.code.js-syntax-highlight
|
|
|
|
.line-numbers
|
2016-02-05 11:20:29 -05:00
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
2016-03-03 12:38:44 -05:00
|
|
|
- Gitlab::Git::Util.count_lines(chunk[:data]).times do |index|
|
2016-02-05 11:20:29 -05:00
|
|
|
- offset = defined?(chunk[:start_line]) ? chunk[:start_line] : 1
|
2016-01-21 08:23:53 -05:00
|
|
|
- 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
|
2016-02-05 11:20:29 -05:00
|
|
|
- unless snippet == snippet_chunks.last
|
2016-01-21 08:23:53 -05:00
|
|
|
%a.diff-line-num
|
|
|
|
= "."
|
|
|
|
%pre.code
|
|
|
|
%code
|
2016-02-05 11:20:29 -05:00
|
|
|
- snippet_chunks.each do |chunk|
|
|
|
|
- unless chunk[:data].empty?
|
|
|
|
= chunk[:data]
|
|
|
|
- unless chunk == snippet_chunks.last
|
2014-08-29 15:22:45 -04:00
|
|
|
%a
|
2016-01-21 08:23:53 -05:00
|
|
|
= "..."
|
|
|
|
- else
|
|
|
|
.file-content.code
|
|
|
|
.nothing-here-block Empty file
|