From 437982178796e3465d39baaa1ca1fafd7782c4f9 Mon Sep 17 00:00:00 2001 From: Alexander Makarenko Date: Thu, 24 Sep 2015 11:24:23 +0300 Subject: [PATCH] Sort packages before rendering in UI --- lib/index-web.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/index-web.js b/lib/index-web.js index caef8f992..d1a15a9ce 100644 --- a/lib/index-web.js +++ b/lib/index-web.js @@ -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,