diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-06-10 15:42:43 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-06-27 14:17:49 -0700 |
commit | f8b80f7faedef7515d05abd9a5cc315d98724ae3 (patch) | |
tree | 9f0079320c6edbf2ded9221960d2f71e1aca5053 /app/views | |
parent | 0fd4b9d3e2c800e728e17e919fa7369b3322c65b (diff) | |
download | gitlab-ce-f8b80f7faedef7515d05abd9a5cc315d98724ae3.tar.gz |
add custom highlighting via .gitattributes
paired with @stanhu
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/blob/_text.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_file_highlight.html.haml | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/views/projects/blob/_text.html.haml b/app/views/projects/blob/_text.html.haml index b1769759dce..58524418a67 100644 --- a/app/views/projects/blob/_text.html.haml +++ b/app/views/projects/blob/_text.html.haml @@ -16,4 +16,4 @@ .file-content.code .nothing-here-block Empty file - else - = render 'shared/file_highlight', blob: blob + = render 'shared/file_highlight', blob: blob, repository: @repository diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index ad944a19ca1..e26693bf5b9 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -1,3 +1,5 @@ +- repository = nil unless local_assigns.key?(:repository) + .file-content.code.js-syntax-highlight .line-numbers - if blob.data.present? @@ -11,4 +13,4 @@ = link_icon = i .blob-content{data: {blob_id: blob.id}} - = highlight(blob.name, blob.data, plain: blob.no_highlighting?) + = highlight(blob.path, blob.data, repository: repository, plain: blob.no_highlighting?) |