added last commit message to repositorybrowser

This commit is contained in:
Sebastian Sdorra
2011-06-13 13:14:25 +02:00
parent a9061d8592
commit f8483c22af
3 changed files with 34 additions and 2 deletions

View File

@@ -71,13 +71,15 @@ for dir in directories:
print ' </file>'
for file in files:
time = file.date()[0]
desc = repo[file.linkrev()].description()
print ' <file>'
print ' <name>' + getName(file.path()) + '</name>'
print ' <path>' + file.path() + '</path>'
print ' <directory>false</directory>'
print ' <length>' + str(file.size()) + '</length>'
time = file.date()[0]
print ' <lastModified>' + str(time).split('.')[0] + '</lastModified>'
print ' <description>' + desc + '</description>'
print ' </file>'
print ' </children>'
print ' </file>'

View File

@@ -90,6 +90,17 @@ public class FileObject implements LastModifiedAware, Iterable<FileObject>
return children;
}
/**
* Method description
*
*
* @return
*/
public String getDescription()
{
return description;
}
/**
* Method description
*
@@ -159,6 +170,17 @@ public class FileObject implements LastModifiedAware, Iterable<FileObject>
this.children = children;
}
/**
* Method description
*
*
* @param description
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* Method description
*
@@ -221,6 +243,9 @@ public class FileObject implements LastModifiedAware, Iterable<FileObject>
@XmlElementWrapper(name = "children")
private List<FileObject> children;
/** Field description */
private String description;
/** Field description */
private boolean directory;

View File

@@ -46,7 +46,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
url: restUrl + 'repositories/' + this.repository.id + '/browse.json',
method: 'GET'
}),
fields: ['path', 'name', 'length', 'lastModified', 'directory'],
fields: ['path', 'name', 'length', 'lastModified', 'directory', 'description'],
root: 'file.children',
idProperty: 'path',
autoLoad: true,
@@ -80,10 +80,15 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
dataIndex: 'lastModified',
header: 'LastModified',
renderer: Ext.util.Format.formatTimestamp
},{
id: 'description',
dataIndex: 'description',
header: 'Description'
}]
});
var config = {
autoExpandColumn: 'description',
title: String.format(this.repositoryBrowserTitleText, this.repository.name),
store: browserStore,
colModel: browserColModel,