diff --git a/src/views/appstore.html b/src/views/appstore.html index 5c09ac21c..6049d4f86 100644 --- a/src/views/appstore.html +++ b/src/views/appstore.html @@ -290,7 +290,33 @@
{{ 'appstore.appMissing' | tr }} +
+
+
+

{{ 'appstore.category.popular' | tr }}

+
+
+
+
+
+ {{ 'appstore.unstable' | tr }} +
+ +
+
+

{{ app.manifest.title }}

+ +
+
+
+
+
+
+
+

{{ 'appstore.category.all' | tr }}

+
+
diff --git a/src/views/appstore.js b/src/views/appstore.js index 2fbe83db2..05674836d 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -14,6 +14,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran $scope.ready = false; $scope.apps = []; + $scope.popularApps = []; $scope.config = Client.getConfig(); $scope.user = Client.getUserInfo(); $scope.users = []; @@ -425,6 +426,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran var token = $scope.searchString.toUpperCase(); + $scope.popularApps = []; $scope.apps = apps.filter(function (app) { if (app.manifest.id.toUpperCase().indexOf(token) !== -1) return true; if (app.manifest.title.toUpperCase().indexOf(token) !== -1) return true; @@ -432,7 +434,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran if (app.manifest.tags.join().toUpperCase().indexOf(token) !== -1) return true; if (app.manifest.description.toUpperCase().indexOf(token) !== -1) return true; return false; - }); + }); }); }; @@ -471,7 +473,9 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran if (error) return $timeout($scope.showCategory.bind(null, category), 1000); if (!$scope.category) { - $scope.apps = apps.slice(0).sort(function (a1, a2) { return a1.manifest.title.localeCompare(a2.manifest.title); }); + $scope.apps = apps.slice(0).filter(function (app) { return !app.featured; }).sort(function (a1, a2) { return a1.manifest.title.localeCompare(a2.manifest.title); }); + $scope.popularApps = apps.slice(0).filter(function (app) { return app.featured; }).sort(function (a1, a2) { return a2.ranking - a1.ranking; }); + // $scope.apps = apps.slice(0).sort(function (a1, a2) { return a1.manifest.title.localeCompare(a2.manifest.title); }); } else if ($scope.category === 'featured') { $scope.apps = apps.filter(function (app) { return app.featured; }).sort(function (a1, a2) { return a2.ranking - a1.ranking; }); // reverse sort } else if ($scope.category === 'new') {