diff --git a/src/js/index.js b/src/js/index.js index 29a8d3689..89130dd52 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -209,6 +209,36 @@ app.filter('shortAppMessage', function () { }; }); +app.filter('selectedTagFilter', function () { + return function selectedTagFilter(apps, selectedTags) { + return apps.filter(function (app) { + if (selectedTags.length === 0) return true; + + return !!selectedTags.find(function (tag) { + return !app.tags ? false : (app.tags.indexOf(tag) !== -1); + }); + }); + }; +}); + +app.filter('selectedDomainFilter', function () { + return function selectedDomainFilter(apps, selectedDomains) { + return apps.filter(function (app) { + if (selectedDomains.length === 0) return true; + + return !!selectedDomains.find(function (domain) { + return app.domain === domain.domain; + }); + }); + }; +}); + +app.filter('prettyDomains', function () { + return function prettyDomains(domains) { + return domains.map(function (d) { return d.domain; }).join(', '); + }; +}); + app.filter('prettyMemory', function () { return function (memory) { // Adjust the default memory limit if it changes diff --git a/src/theme.scss b/src/theme.scss index f53a46ebb..9cbffae5b 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -250,49 +250,6 @@ h1, h2, h3 { // Apps view // ---------------------------- -.domain-header { - padding-left: 15px; - font-size: 24px; -} - -.tags-sidebar { - position: absolute; - left: 10px; - top: 50px; - - h1 { - font-size: 14px; - } - - .tag { - display: block; - padding: 6px 10px; - margin: 0; - overflow: hidden; - color: black; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 16px; - - &:hover, - &:focus, - &.tag-active { - text-decoration: none; - background-color: white; - color: black; - } - - &.tag-active { - background-color: $navbar-default-link-hover-color; - color: white; - } - - & > i { - width: 30px; - } - } -} - .app-grid { display: flex; flex-wrap: wrap; diff --git a/src/views/apps.html b/src/views/apps.html index 539896aff..b090985b2 100644 --- a/src/views/apps.html +++ b/src/views/apps.html @@ -512,61 +512,59 @@
-

Your Apps

-
- -
-

Tags

-
{{ tag }}
+

+ Your Apps +
+ + +
+

-
-

{{ domain.domain }}

-
-
- -
-
-
-
-
- -
-
+
+ diff --git a/src/views/apps.js b/src/views/apps.js index f8376a891..36820c33c 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -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);