From a8b62fc184895ede760bb8427527b0427901467c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Tue, 26 May 2015 15:23:09 +0200 Subject: [PATCH] Fix score display on dashboard --- front/src/js/controllers/dashboardCtrl.js | 2 ++ front/src/views/dashboard.html | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/front/src/js/controllers/dashboardCtrl.js b/front/src/js/controllers/dashboardCtrl.js index 8efc959..38b3f95 100644 --- a/front/src/js/controllers/dashboardCtrl.js +++ b/front/src/js/controllers/dashboardCtrl.js @@ -25,6 +25,8 @@ dashboardCtrl.controller('DashboardCtrl', ['$scope', '$rootScope', '$routeParams // By default, Angular sorts object's attributes alphabetically. Countering this problem by retrieving the keys order here. $scope.categoriesOrder = Object.keys($scope.result.scoreProfiles.generic.categories); + $scope.globalScore = Math.max($scope.result.scoreProfiles.generic.globalScore, 0); + $scope.tweetText = 'I\'ve discovered this cool open-source tool that audits the front-end quality of a web page: '; } diff --git a/front/src/views/dashboard.html b/front/src/views/dashboard.html index 57c26f3..fa97376 100644 --- a/front/src/views/dashboard.html +++ b/front/src/views/dashboard.html @@ -1,12 +1,12 @@
- -
+ +

Global score

-
{{result.scoreProfiles.generic.globalScore}}/100
+
{{globalScore}}/100