maatma: display progress on home page
This commit is contained in:
parent
6dbd0107a0
commit
6000b5dd2e
@ -49,6 +49,7 @@ angular.module("AdLinApp")
|
|||||||
}
|
}
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
$rootScope.isLogged = response.data;
|
$rootScope.isLogged = response.data;
|
||||||
|
$rootScope.student = response.data;
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
$rootScope.isLogged = false;
|
$rootScope.isLogged = false;
|
||||||
});
|
});
|
||||||
@ -63,6 +64,17 @@ angular.module("AdLinApp")
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
.controller("ProgressionController", function($scope, $interval, $http) {
|
||||||
|
$scope.mychallenges = {};
|
||||||
|
var refreshChal = function() {
|
||||||
|
$http.get("/api/students/" + $scope.student.id + "/progress").then(function(response) {
|
||||||
|
$scope.mychallenges = response.data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
refreshChal();
|
||||||
|
$interval(refreshChal, 15750);
|
||||||
|
})
|
||||||
|
|
||||||
.controller("AuthController", function($scope, $rootScope, $http, $location) {
|
.controller("AuthController", function($scope, $rootScope, $http, $location) {
|
||||||
$scope.auth = {
|
$scope.auth = {
|
||||||
"username": "",
|
"username": "",
|
||||||
|
@ -13,6 +13,12 @@
|
|||||||
<h2 ng-if="isLogged">
|
<h2 ng-if="isLogged">
|
||||||
Qu'allons-nous faire aujourd'hui ?
|
Qu'allons-nous faire aujourd'hui ?
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
<div ng-controller="ProgressionController" ng-if="isLogged">
|
||||||
|
<span class="badge" ng-class="{'badge-success': mychallenges[100], 'badge-danger': !mychallenges[100]}">HTTP</span>
|
||||||
|
<span class="badge" ng-class="{'badge-success': mychallenges[101], 'badge-danger': !mychallenges[101]}">HTTPS</span>
|
||||||
|
<span class="badge" ng-class="{'badge-success': mychallenges[102], 'badge-danger': !mychallenges[102]}">DNS</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-deck">
|
<div class="card-deck">
|
||||||
|
Reference in New Issue
Block a user