mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
added author to changesets
This commit is contained in:
@@ -814,9 +814,10 @@ Ext.reg('repositoryPanel', Sonia.repository.Panel);
|
||||
Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
|
||||
|
||||
repository: null,
|
||||
changesetMetadataTemplate: '<div class="changeset-description">{description:htmlEncode}</div>\
|
||||
<div class="changeset-author">{author:htmlEncode}</div>\
|
||||
<div class="changeset-date">{date:formatTimestamp}</div>',
|
||||
mailTemplate: '<<a href="mailto: {0}">{0}</a>>',
|
||||
changesetMetadataTemplate: '<div class="changeset-description">{0}</div>\
|
||||
<div class="changeset-author">{1}</div>\
|
||||
<div class="changeset-date">{2}</div>',
|
||||
modificationsTemplate: 'A: {0}, M: {1}, D: {2}',
|
||||
idsTemplate: 'Commit: {0}',
|
||||
tagsAndBranchesTemplate: '<div class="changeset-tags">{0}</div>\
|
||||
@@ -831,9 +832,9 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
|
||||
},
|
||||
columns: [{
|
||||
id: 'metadata',
|
||||
xtype: 'templatecolumn',
|
||||
dataIndex: 'author',
|
||||
tpl: this.changesetMetadataTemplate
|
||||
renderer: this.renderChangesetMetadata,
|
||||
scope: this
|
||||
},{
|
||||
id: 'tagsAndBranches',
|
||||
renderer: this.renderTagsAndBranches,
|
||||
@@ -867,6 +868,30 @@ Sonia.repository.ChangesetViewerGrid = Ext.extend(Ext.grid.GridPanel, {
|
||||
Sonia.repository.ChangesetViewerGrid.superclass.initComponent.apply(this, arguments);
|
||||
},
|
||||
|
||||
renderChangesetMetadata: function(author, p, record){
|
||||
var authorValue = '';
|
||||
if ( author != null ){
|
||||
authorValue = Ext.util.Format.htmlEncode(author.name);
|
||||
if ( author.mail != null ){
|
||||
authorValue += ' ' + String.format(this.mailTemplate, author.mail);
|
||||
}
|
||||
}
|
||||
var description = record.data.description;
|
||||
if ( description != null ){
|
||||
description = Ext.util.Format.htmlEncode(description);
|
||||
}
|
||||
var date = record.data.date;
|
||||
if ( date != null ){
|
||||
date = Ext.util.Format.formatTimestamp(date);
|
||||
}
|
||||
return String.format(
|
||||
this.changesetMetadataTemplate,
|
||||
description,
|
||||
authorValue,
|
||||
date
|
||||
);
|
||||
},
|
||||
|
||||
renderTagsAndBranches: function(value, p, record){
|
||||
var tags = this.getLabeledValue("Tags", record.data.tags);
|
||||
var branches = this.getLabeledValue("Branches", record.data.branches);
|
||||
|
||||
Reference in New Issue
Block a user