rosa-build/app/views/git/blobs/blame.html.haml

57 lines
2.0 KiB
Plaintext
Raw Normal View History

2011-04-04 12:28:33 +01:00
.block
2011-04-04 17:00:24 +01:00
= render :partial => "git/shared/navigation"
2011-04-04 12:28:33 +01:00
2011-04-04 17:00:24 +01:00
= render :partial => "git/shared/info"
2011-04-04 12:28:33 +01:00
- if @commit
.block
.content
.inner
= render :partial => "git/commits/commits", :object => [@commit]
2011-04-04 12:28:33 +01:00
.block
.content
.inner
%h3= render_path
.blob_header
.size #{(@blob.size / 1024.0).round(3)} Kb
.buttons
- if @commit_hash
#{link_to "Raw", raw_commit_path(@project, @commit_hash, @path)} #{link_to "Normal", blob_commit_path(@project, @commit_hash, @path)} #{link_to "History", commits_path(@project, @treeish, @path)}
- else
#{link_to "Raw", raw_path(@project, @treeish, @path)} #{link_to "Normal", blob_path(@project, @treeish, @path)} #{link_to "History", commits_path(@project, @treeish, @path)}
2011-04-04 12:28:33 +01:00
.clear
.blame_data
%table.table.blame
- index = 1
- @blame.each do |elem|
%tr
%td.message{ :rowspan => elem[1].length }
2012-02-04 20:12:37 +00:00
.commit
#{link_to shortest_hash_id(elem[0].id), commit_path(@project, elem[0].id)} by
#{elem[0].author.to_s.encode_to_default} #{elem[0].author != elem[0].committer ? "(#{elem[0].committer.to_s.encode_to_default})" : "" }
2011-04-04 12:28:33 +01:00
.message
%span.date= commit_date(elem[0].committed_date)
%span.message= short_commit_message(elem[0].message)
%td.lines
= index
- index += 1
%td.code
%pre
2012-02-04 20:12:37 +00:00
%div= elem[1].first.force_encoding(Encoding.default_internal || Encoding::UTF_8)
2011-04-04 12:28:33 +01:00
- elem[1][1..-1].each do |line|
%tr
%td.lines
= index
- index += 1
%td.code
%pre
2012-02-04 20:12:37 +00:00
%div= line.force_encoding(Encoding.default_internal || Encoding::UTF_8)
2011-04-04 12:28:33 +01:00
2012-02-04 20:12:37 +00:00
- content_for :sidebar, render(:partial => 'git/shared/sidebar')