dashboard: improve overall design
This commit is contained in:
parent
e9a08dde9e
commit
25183e2248
2 changed files with 23 additions and 14 deletions
|
@ -31,6 +31,9 @@ angular.module("AdLinApp", ["ngResource", "ngSanitize"])
|
|||
});
|
||||
|
||||
angular.module("AdLinApp")
|
||||
.run(function($rootScope, $location) {
|
||||
$rootScope.tutoid = 1;
|
||||
})
|
||||
.controller("StudentsController", function($scope, $interval, Student) {
|
||||
$scope.students = Student.query();
|
||||
var refreshStd = function() {
|
||||
|
@ -62,7 +65,14 @@ angular.module("AdLinApp")
|
|||
$scope.tuto_progress = tuto_progress;
|
||||
$scope.mychallenges = {};
|
||||
var refreshChal = function() {
|
||||
var recent = new Date(Date.now() - 120000);
|
||||
$http.get("/api/students/" + $scope.student.id + "/progress").then(function(response) {
|
||||
angular.forEach(response.data, function(ch, chid) {
|
||||
if (ch.time) {
|
||||
response.data[chid].time = new Date(ch.time);
|
||||
response.data[chid].recent = recent < response.data[chid].time;
|
||||
}
|
||||
});
|
||||
$scope.mychallenges = response.data
|
||||
});
|
||||
}
|
||||
|
|
Reference in a new issue