summaryrefslogtreecommitdiff
path: root/app/views/search
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-21 14:23:53 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-21 14:23:53 +0100
commit21facf535377ad58d07e8943033fe14efface8b2 (patch)
tree020fc70236a38f44f67faeb7a6f387dd250f01f4 /app/views/search
parenta4ff270d59ef951538cb9d3962ebc8bc7d990016 (diff)
downloadgitlab-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.haml42
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