Selaa lähdekoodia

Merge branch 'develop'

Gaël Métais 10 vuotta sitten
vanhempi
commit
d998c7cd46
2 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 2 0
      front/src/js/controllers/dashboardCtrl.js
  2. 3 3
      front/src/views/dashboard.html

+ 2 - 0
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: ';
     }
 

+ 3 - 3
front/src/views/dashboard.html

@@ -1,12 +1,12 @@
 <div ng-include="'views/resultSubHeader.html'"></div>
 <div class="summary board">
-
-    <div class="globalScore" ng-if="result.scoreProfiles.generic.globalScore === 0 || result.scoreProfiles.generic.globalScore > 0">
+    
+    <div class="globalScore" ng-if="globalScore === 0 || globalScore > 0">
         <div>
             <h2>Global score</h2>
             <div class="globalScoreDisplay">
                 <grade score="result.scoreProfiles.generic.globalScore" class="globalGrade"></grade>
-                <div class="on100">{{result.scoreProfiles.generic.globalScore}}/100</div>
+                <div class="on100">{{globalScore}}/100</div>
             </div>
         </div>
         <div>