Simplify the app grid filter to basic dropdowns for now

This commit is contained in:
Johannes Zellner
2019-04-15 14:31:12 +02:00
parent 0b8e5a75f1
commit 07d4d5051a
4 changed files with 75 additions and 99 deletions

View File

@@ -9,6 +9,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.installedApps = Client.getInstalledApps();
$scope.tags = Client.getAppTags();
$scope.selectedTags = [];
$scope.selectedDomains = [];
$scope.config = Client.getConfig();
$scope.user = Client.getUserInfo();
$scope.domains = [];
@@ -19,16 +20,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.spacesSuffix = '';
$scope.disableIndexingTemplate = '# Disable search engine indexing\n\nUser-agent: *\nDisallow: /';
$scope.domainHasApps = function (domain) {
return !!$scope.installedApps.find(function (a) { return a.domain === domain.domain; });
};
$scope.moreThanOneDomainHasApps = function () {
return $scope.installedApps.map(function (a) { return a.domain; }).filter(function (item, pos, self) {
return self.indexOf(item) === pos;
}).length > 1;
};
$scope.toggleTag = function (tag) {
var pos = $scope.selectedTags.indexOf(tag);
if (pos !== -1) $scope.selectedTags.splice(pos, 1);