Sort packages before rendering in UI

This commit is contained in:
Alexander Makarenko 2015-09-24 11:24:23 +03:00
parent 6b3617754c
commit 4379821787
1 changed files with 9 additions and 0 deletions

View File

@ -55,6 +55,15 @@ module.exports = function(config, auth, storage) {
})
})
}, function(packages) {
packages.sort(function(p1, p2) {
if (p1.name < p2.name) {
return -1;
}
else {
return 1;
}
});
next(template({
name: config.web && config.web.title ? config.web.title : 'Sinopia',
packages: packages,