Some cleanups for showing popular and section names depending on category and search

(cherry picked from commit 5d5c712f1c)
This commit is contained in:
Johannes Zellner
2021-03-18 14:28:22 +01:00
committed by Girish Ramakrishnan
parent 611462ffd7
commit 500da2df25
3 changed files with 7 additions and 7 deletions
+5
View File
@@ -796,6 +796,11 @@ multiselect {
margin-top: 65px;
width: calc(100% - 30px); // -30px to offset .row margins
max-width: 1200px;
h2 {
font-size: 20px;
margin-top: 10px;
}
}
.appstore-item {
+2 -3
View File
@@ -265,10 +265,9 @@
<div ng-show="ready && validSubscription" class="ng-cloak appstore-toolbar">
<div class="appstore-toolbar-content">
<button class="btn" type="button" ng-click="showCategory('');" ng-class="{ 'btn-primary': '' === category }">{{ 'appstore.category.all' | tr }}</button>
<button class="btn" type="button" ng-click="showCategory('featured');" ng-class="{ 'btn-primary': 'featured' === category }">{{ 'appstore.category.popular' | tr }}</button>
<button class="btn" type="button" ng-click="showCategory('new');" ng-class="{ 'btn-primary': 'new' === category }">{{ 'appstore.category.newApps' | tr }}</button>
<div class="dropdown">
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown" ng-class="{ 'btn-primary': '' !== category && 'recent' !== category && 'featured' !== category && 'new' !== category }">
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown" ng-class="{ 'btn-primary': '' !== category && 'recent' !== category && 'new' !== category }">
{{ categoryButtonLabel(category) }}
<span class="caret"></span>
</button>
@@ -312,7 +311,7 @@
</div>
</div>
<div class="col-md-12" ng-show="apps.length">
<div class="row-no-margin">
<div class="row-no-margin" ng-show="!category && !searchString">
<div class="col-sm-12">
<h2>{{ 'appstore.category.all' | tr }}</h2>
</div>
-4
View File
@@ -80,7 +80,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran
if (category === 'new') return categoryLabel;
if (category === 'recent') return categoryLabel;
if (category === 'featured') return categoryLabel;
var tmp = $scope.categories.find(function (c) { return c.id === category; });
if (tmp) return tmp.label;
@@ -475,9 +474,6 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran
if (!$scope.category) {
$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') {
$scope.apps = filterForNewApps(apps);
} else if ($scope.category === 'recent') {