merge with branch issue-287

This commit is contained in:
Sebastian Sdorra
2012-12-07 10:00:13 +01:00
5 changed files with 100 additions and 28 deletions

View File

@@ -203,20 +203,28 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
}
return result;
},
getChangesetId: function(id, record){
return id;
},
getParentIds: function(id, record){
return record.get('parents');
},
renderIds: function(value, p, record){
var parent = null;
var parents = this.getParentIds(value, record);
var parent1 = null;
var parent2 = null;
var parents = record.get('parents');
if ( parents ){
parent = parents[0];
if ( parents.length >= 1 ){
parent1 = parents[0];
if (parents.length > 1){
parent2 = parents[1];
}
}
return this.idsTemplate.apply({
id: value,
parent: parent,
id: this.getChangesetId(value, record),
parent: parent1,
parent2: parent2
});
},

View File

@@ -178,4 +178,18 @@ if (!Array.prototype.filter) {
return results;
}
}
Sonia.util.getProperty = function(properties, key){
var value = null;
if ( properties != null ){
for (var i=0; i<properties.length; i++){
var property = properties[i];
if ( property.key == key ){
value = property.value;
break;
}
}
}
return value;
}