BigW Consortium Gitlab

_file_highlight.html.haml 738 Bytes
Newer Older
1 2
- repository = nil unless local_assigns.key?(:repository)

3
.file-content.code.js-syntax-highlight
4
  .line-numbers
Dmitriy Zaporozhets committed
5
    - if blob.data.present?
6
      - link_icon = icon('link')
barthc committed
7
      - link = blob_link if defined?(blob_link)
8
      - blob.data.each_line.each_with_index do |_, index|
Dmitriy Zaporozhets committed
9 10
        - offset = defined?(first_line_number) ? first_line_number : 1
        - i = index + offset
11
        -# We're not using `link_to` because it is too slow once we get to thousands of lines.
12
        %a.diff-line-num{ href: "#{link}#L#{i}", id: "L#{i}", 'data-line-number' => i }
13
          = link_icon
Dmitriy Zaporozhets committed
14
          = i
15
  .blob-content{ data: { blob_id: blob.id } }
16
    = highlight(blob.path, blob.data, repository: repository, plain: blob.no_highlighting?)