diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-01-21 14:23:53 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-01-21 14:23:53 +0100 |
commit | 21facf535377ad58d07e8943033fe14efface8b2 (patch) | |
tree | 020fc70236a38f44f67faeb7a6f387dd250f01f4 /app/views/search | |
parent | a4ff270d59ef951538cb9d3962ebc8bc7d990016 (diff) | |
download | gitlab-ce-21facf535377ad58d07e8943033fe14efface8b2.tar.gz |
Use consistent markup and styling for highlighting across blobs, diffs, blame and snippets
Diffstat (limited to 'app/views/search')
-rw-r--r-- | app/views/search/results/_snippet_blob.html.haml | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml index 9a4f9fb9485..dcd61199717 100644 --- a/app/views/search/results/_snippet_blob.html.haml +++ b/app/views/search/results/_snippet_blob.html.haml @@ -22,29 +22,27 @@ .file-content.code .nothing-here-block Empty file - else - .file-content.code - %div.highlighted-data{ class: user_color_scheme } - .line-numbers + .file-content.code.js-syntax-highlight + .line-numbers + - snippet_blob[:snippet_chunks].each do |snippet| + - unless snippet[:data].empty? + - snippet[:data].lines.to_a.size.times do |index| + - offset = defined?(snippet[:start_line]) ? snippet[: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 + - unless snippet == snippet_blob[:snippet_chunks].last + %a.diff-line-num + = "." + %pre.code + %code - snippet_blob[:snippet_chunks].each do |snippet| - unless snippet[:data].empty? - - snippet[:data].lines.to_a.size.times do |index| - - offset = defined?(snippet[:start_line]) ? snippet[:start_line] : 1 - - i = index + offset - = link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}" do - %i.fa.fa-link - = i + = snippet[:data] - unless snippet == snippet_blob[:snippet_chunks].last %a - = "." - .highlight.term - %pre - %code - - snippet_blob[:snippet_chunks].each do |snippet| - - unless snippet[:data].empty? - = snippet[:data] - - unless snippet == snippet_blob[:snippet_chunks].last - %a - = "..." - - else - .file-content.code - .nothing-here-block Empty file + = "..." + - else + .file-content.code + .nothing-here-block Empty file |