diff --git a/src/theme.scss b/src/theme.scss index 486ba6ac1..7b531b1d4 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -702,6 +702,53 @@ multiselect { } } +.appstore-toolbar { + position: fixed; + z-index: 1000; + width: 100%; + padding: 10px; + width: 100%; + background: $body-bg; + + .appstore-toolbar-content { + display: flex; + margin: auto; + max-width: 1200px; + + > input { + margin: 0 10px; + } + + > button, > .dropdown { + border-radius: 0; + display: inline-block; + } + + @media(max-width:768px) { + flex-wrap: wrap; + + > input { + margin: 10px; + } + + > button, > .dropdown { + display: none; + } + } + } +} + +.appstore-grid { + margin: auto; + margin-top: 50px; + width: 100%; + max-width: 1200px; + + @media(max-width:768px) { + margin-top: 50px; + } +} + .appstore-item { padding: 10px; width: 300px; diff --git a/src/views/appstore.html b/src/views/appstore.html index c147016ff..cfa0de7d9 100644 --- a/src/views/appstore.html +++ b/src/views/appstore.html @@ -270,66 +270,56 @@
-
-
+
+
-
-
-
-
-
-
- -
-
-
-
- Popular - New Apps - Recently Updated - All -
- Analytics - Blog - Chat - Code Hosting - CRM - Documents - Email - File Sync - Finance - Forum - Gallery - Games - Notes - Project Management - VPN - Web Hosting - Wiki -
-
- Missing an app? Let us know. +
+
+ + + + -
-
-
-
- Unstable -
- -
-
-

{{ app.manifest.title }}

- - -
-
+ +
+
+ +
+
+ +
+

{{ categoryLabel(category) }}

+
+
+
+ Unstable +
+
+
+

{{ app.manifest.title }}

+ + +
+
+
+
diff --git a/src/views/appstore.js b/src/views/appstore.js index b5c3fb9d4..df1ea31dc 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -39,6 +39,36 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca $('.modal').modal('hide'); }; + $scope.categories = [ + { id: 'analytics', icon: 'fa fa-chart-line', label: 'Analytics'}, + { id: 'blog', icon: 'fa fa-font', label: 'Blog'}, + { id: 'chat', icon: 'fa fa-comments', label: 'Chat'}, + { id: 'git', icon: 'fa fa-code-branch', label: 'Code Hosting'}, + { id: 'crm', icon: 'fab fa-connectdevelop', label: 'CRM'}, + { id: 'document', icon: 'fa fa-file-word', label: 'Documents'}, + { id: 'email', icon: 'fa fa-envelope', label: 'Email'}, + { id: 'sync', icon: 'fa fa-sync-alt', label: 'File Sync'}, + { id: 'finance', icon: 'fa fa-hand-holding-usd', label: 'Finance'}, + { id: 'forum', icon: 'fa fa-users', label: 'Forum'}, + { id: 'gallery', icon: 'fa fa-images', label: 'Gallery'}, + { id: 'game', icon: 'fa fa-gamepad', label: 'Games'}, + { id: 'notes', icon: 'fa fa-sticky-note', label: 'Notes'}, + { id: 'project', icon: 'fas fa-project-diagram', label: 'Project Management'}, + { id: 'vpn', icon: 'fa fa-user-secret', label: 'VPN'}, + { id: 'hosting', icon: 'fa fa-server', label: 'Web Hosting'}, + { id: 'wiki', icon: 'fab fa-wikipedia-w', label: 'Wiki'}, + ]; + + $scope.categoryLabel = function (category) { + if (category === 'new') return 'New Apps'; + if (category === 'recent') return 'Recently Updated'; + + var tmp = $scope.categories.find(function (c) { return c.id === category; }); + if (tmp) return tmp.label; + + return ''; + }; + $scope.appInstall = { busy: false, state: 'appInfo', @@ -338,8 +368,8 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca Client.getAppstoreApps(function (error) { if (error) return callback(error); - // start with featured apps listing. this also sets $scope.apps accordingly - $scope.showCategory(null, 'featured'); + // start with all apps listing. this also sets $scope.apps accordingly + $scope.showCategory(''); // do this in background fetchUsers(); @@ -385,7 +415,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca }; function filterForNewApps(apps) { - var minApps = apps.length < 5 ? apps.length : 5; // prevent endless loop + var minApps = apps.length < 10 ? apps.length : 10; // prevent endless loop var tmp = []; var i = 0; @@ -398,7 +428,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca } function filterForRecentlyUpdatedApps(apps) { - var minApps = apps.length < 5 ? apps.length : 5; // prevent endless loop + var minApps = apps.length < 10 ? apps.length : 10; // prevent endless loop var tmp = []; var i = 0; @@ -410,14 +440,13 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca return tmp; } - $scope.showCategory = function (event, category) { - if (!event) $scope.category = category; - else $scope.category = event.target.getAttribute('category'); + $scope.showCategory = function (category) { + $scope.category = category; $scope.cachedCategory = $scope.category; Client.getAppstoreAppsFast(function (error, apps) { - if (error) return $timeout($scope.showCategory.bind(null, event), 1000); + if (error) return $timeout($scope.showCategory.bind(null, category), 1000); if (!$scope.category) { $scope.apps = apps;