summaryrefslogtreecommitdiff
path: root/app/views/projects/blame/show.html.haml
blob: a3ff7ce2f1ffdb666d1d97143af8caba2f4b0a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- page_title "Blame", @blob.path, @ref
%h3.page-title Blame view

#tree-holder.tree-holder
  .file-holder
    .file-title
      %i.fa.fa-file
      %strong
        = @path
      %small= number_to_human_size @blob.size
      .file-actions
        = render "projects/blob/actions"
    .file-content.blame.highlight
      %table
        - current_line = 1
        - @blame.each do |blame_group|
          %tr
            %td.blame-commit
              .commit
                - commit = Commit.new(blame_group[:commit], @project)
                .commit-row-title
                  %strong
                    = link_to_gfm truncate(commit.title, length: 35), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "cdark"
                  .pull-right
                    = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "monospace"
                   
                .light
                  = commit_author_link(commit, avatar: false)
                  authored
                  #{time_ago_with_tooltip(commit.committed_date)}
            %td.lines.blame-numbers
              %pre
                - line_count = blame_group[:lines].count
                - (current_line...(current_line + line_count)).each do |i|
                  = i
                  \
                - current_line += line_count
            %td.lines
              %pre{class: 'code highlight white'}
                %code
                  - blame_group[:lines].each do |line|
                    :erb
                      <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %>