2012-03-05 15:29:05 +00:00
|
|
|
%table.table.blame
|
|
|
|
- index = 1
|
|
|
|
- @blame.each do |elem|
|
|
|
|
%tr.firstrow
|
|
|
|
%td.commit_info{ :rowspan => elem[1].length, :nowrap => 'nowrap' }
|
|
|
|
%code
|
2012-03-05 16:31:09 +00:00
|
|
|
#{link_to shortest_hash_id(elem[0].id), commit_path(@project, elem[0].id)} #{t('layout.by')}
|
2012-03-05 15:29:05 +00:00
|
|
|
- author = elem[0].author
|
|
|
|
- committer = elem[0].committer
|
|
|
|
= commit_author_link(author)
|
|
|
|
- if author.email != committer.email
|
|
|
|
(#{commit_author_link(committer)})
|
|
|
|
%br
|
|
|
|
%span.date= commit_date(elem[0].committed_date)
|
2012-03-21 19:55:14 +00:00
|
|
|
%span.message{:title => elem[0].message}= short_commit_message(elem[0].message)
|
2012-03-05 15:29:05 +00:00
|
|
|
|
|
|
|
%td.lines
|
|
|
|
= index
|
|
|
|
- index += 1
|
|
|
|
|
|
|
|
%td.code.cm-s-default
|
|
|
|
%pre
|
2012-03-21 19:55:14 +00:00
|
|
|
%div= elem[1].first
|
2012-03-05 15:29:05 +00:00
|
|
|
|
|
|
|
- elem[1][1..-1].each do |line|
|
|
|
|
%tr
|
|
|
|
%td.lines
|
|
|
|
= index
|
|
|
|
- index += 1
|
|
|
|
%td.code.cm-s-default
|
|
|
|
%pre
|
2012-03-21 19:55:14 +00:00
|
|
|
%div= line
|
2012-03-05 15:29:05 +00:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(document).ready(function() {
|
|
|
|
var $code_rows = $('.code.cm-s-default pre div');
|
|
|
|
var mode = "#{File.extname(@blob.name) == '.spec' ? 'text/x-rpm-spec' : @blob.mime_type}"
|
|
|
|
$code_rows.each(function() {
|
|
|
|
CodeMirror.runMode($(this).text().replace(/&/gi, '&'), mode, this.parentElement.parentElement);
|
|
|
|
});
|
|
|
|
});
|