diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-08-10 19:55:03 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-08-11 09:15:00 +0300 |
commit | 5bdcdf56168026134282b1434e716bcf35beaa2c (patch) | |
tree | 09e9b367bf31b1ebdcc244e723c5e3bbc0fbf1c1 /app/views/projects/blame | |
parent | ce30eb2b97d205f818d28005d8b8856533f96e92 (diff) |
Fast blame
Diffstat (limited to 'app/views/projects/blame')
-rw-r--r-- | app/views/projects/blame/show.html.haml | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index 8019c7f4569..1705bda3074 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -12,25 +12,26 @@ = render "projects/blob/actions" .file-content.blame.highlight %table - - @blame.each do |commit, lines, since| - - commit = Commit.new(commit, @project) + - current_line = 1 + - @blame.each do |raw_commit, line| %tr %td.blame-commit %span.commit - = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit_short_id" - - = commit_author_link(commit, avatar: true, size: 16) - - = link_to_gfm truncate(commit.title, length: 20), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "row_title" + - unless @prev_commit && @prev_commit.sha == raw_commit.sha + - commit = Commit.new(raw_commit, @project) + = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit_short_id" + + = commit_author_link(commit, avatar: true, size: 16) + + = link_to_gfm truncate(commit.title, length: 20), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "row_title" + - @prev_commit = raw_commit %td.lines.blame-numbers %pre - - (since...(since + lines.count)).each do |i| - = i - \ + = current_line + - current_line += 1 %td.lines %pre{class: 'code highlight white'} %code :erb - <% lines.each do |line| %> - <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %> - <% end %> + <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %> +
\ No newline at end of file |