diff --git a/src/admin/bundles/bundles-list.controller.js b/src/admin/bundles/bundles-list.controller.js index 69f5917..46ac6fa 100644 --- a/src/admin/bundles/bundles-list.controller.js +++ b/src/admin/bundles/bundles-list.controller.js @@ -6,9 +6,47 @@ bundlesListController.$inject = ['$scope', '$rootScope', 'BundlesFactory']; function bundlesListController ($scope, $rootScope, BundlesFactory) { + $scope.bundles = []; + $scope.search = {}; BundlesFactory.query(function(bundles){ $scope.bundles = bundles; }); + + $scope.allBundlesCount = function () { + if ($scope.bundles) { + return $scope.bundles.length; + } else { + return 0; + } + }; + + $scope.activeBundlesCount = function () { + var count = 0; + angular.forEach($scope.bundles, function (bundle) { + count += bundle.isActive() ? 1 : 0; + }); + + return count; + }; + + $scope.installedBundlesCount = function () { + var count = 0; + angular.forEach($scope.bundles, function (bundle) { + count += bundle.isInstalled() ? 1 : 0; + }); + + return count; + }; + + $scope.resolvedBundlesCount = function () { + var count = 0; + angular.forEach($scope.bundles, function (bundle) { + count += bundle.isResolved() ? 1 : 0; + }); + + return count; + }; + } })(); \ No newline at end of file diff --git a/src/admin/bundles/bundles-list.html b/src/admin/bundles/bundles-list.html index 6754f2b..a3e83fb 100644 --- a/src/admin/bundles/bundles-list.html +++ b/src/admin/bundles/bundles-list.html @@ -1,5 +1,24 @@ - + +
+
+ + +
+
+

{{msg('admin.bundles.statistics')}}

+
+
{{msg('admin.bundles.statistics.total')}}
+
{{allBundlesCount()}}
+
{{msg('admin.bundles.statistics.active')}}
+
{{activeBundlesCount()}}
+
{{msg('admin.bundles.statistics.installed')}}
+
{{installedBundlesCount()}}
+
{{msg('admin.bundles.statistics.resolved')}}
+
{{resolvedBundlesCount()}}
+
+
+
diff --git a/src/admin/bundles/bundles.factory.js b/src/admin/bundles/bundles.factory.js index 9a442e1..ff53fb7 100644 --- a/src/admin/bundles/bundles.factory.js +++ b/src/admin/bundles/bundles.factory.js @@ -29,6 +29,13 @@ return this.state === "ACTIVE"; }; + Bundle.prototype.isInstalled = function () { + return this.state === 'INSTALLED'; + }; + + Bundle.prototype.isResolved = function () { + return this.state === 'RESOLVED'; + }; function callbackSuccess(){ LoadingModal.close(); @@ -75,6 +82,8 @@ }); }; + + return Bundle; } diff --git a/src/common/base/base.scss b/src/common/base/base.scss index 53e672d..4940e26 100644 --- a/src/common/base/base.scss +++ b/src/common/base/base.scss @@ -50,3 +50,9 @@ h3, h4{ position: relative; padding: 0em 1em; } + +dl{ + dt, dd{ + line-height: 1em; + } +} diff --git a/src/common/motech-list/list.base.scss b/src/common/motech-list/list.base.scss index ee21c47..5aaf7d6 100644 --- a/src/common/motech-list/list.base.scss +++ b/src/common/motech-list/list.base.scss @@ -45,6 +45,10 @@ @extend .clearfix; background-color: $brand-accent; padding: $space-size; + >*{ + @extend .navbar; + border-bottom: 0px; + } .pagination{ @extend .button-group-primary; } diff --git a/src/common/navbar.scss b/src/common/navbar.scss index 1716c4c..260eb6d 100644 --- a/src/common/navbar.scss +++ b/src/common/navbar.scss @@ -24,6 +24,7 @@ Styleguide 5.1 padding: 0em 0.5em; display: block; >*{ + margin-bottom: 0px; margin-right: 1em; float: left; } @@ -53,3 +54,18 @@ nav.navbar, border-bottom-color: transparent; } } + +.navbar dl{ + display: inline-block; + >*{ + display: inline-block; + } + dt:after{ + content: ": "; + white-space: pre; + } + dd:after{ + content: ". "; + white-space: pre; + } +}