added simple blame support to user interface

This commit is contained in:
Sebastian Sdorra
2011-09-16 15:55:52 +02:00
parent 52480b72f1
commit 4be252b98e

View File

@@ -51,8 +51,9 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, {
var blameColModel = new Ext.grid.ColumnModel({
columns: [{
id: 'lineNumber',
dataIndex: 'lineNumber',
id: 'revision',
dataIndex: 'revision',
renderer: this.renderRevision,
width: 20
},{
id: 'code',
@@ -67,6 +68,7 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, {
autoExpandColumn: 'code',
store: blameStore,
colModel: blameColModel,
stripeRows: false,
autoHeight: true,
viewConfig: {
forceFit: true
@@ -76,6 +78,17 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, {
Sonia.repository.BlamePanel.superclass.initComponent.apply(this, arguments);
},
renderRevision: function(value, metadata, record){
var title = 'Revision: ' + value;
var tip = 'Author: ' + record.get('author').name + '<br />';
var when = record.get('when');
if ( when ){
tip += 'When: ' + Ext.util.Format.formatTimestamp(when);
}
metadata.attr = 'ext:qtitle="' + title + '"' + ' ext:qtip="' + tip + '"';
return '<a>' + value + '</a>';
},
renderCode: function(value){
return '<pre>' + Ext.util.Format.htmlEncode(value) + '</pre>';
}