admin: new page to see score details

This commit is contained in:
nemunaire 2019-01-17 13:51:44 +01:00
parent 4a4d0f634a
commit 024ae04f45
3 changed files with 59 additions and 2 deletions

View file

@ -49,6 +49,10 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
controller: "TeamController",
templateUrl: "views/team-stats.html"
})
.when("/teams/:teamId/score", {
controller: "TeamController",
templateUrl: "views/team-score.html"
})
.when("/public/:screenId", {
controller: "PublicController",
templateUrl: "views/public.html"
@ -182,6 +186,9 @@ angular.module("FICApp")
.factory("TeamHistory", function($resource) {
return $resource("/api/teams/:teamId/history.json", { teamId: '@id' })
})
.factory("TeamScore", function($resource) {
return $resource("/api/teams/:teamId/score-grid.json", { teamId: '@id' })
})
.factory("TeamStats", function($resource) {
return $resource("/api/teams/:teamId/stats.json", { teamId: '@id' })
})
@ -1379,6 +1386,9 @@ angular.module("FICApp")
$scope.showStats = function() {
$location.url("/teams/" + $scope.team.id + "/stats");
}
$scope.showScore = function() {
$location.url("/teams/" + $scope.team.id + "/score");
}
})
.controller("TeamHistoryController", function($scope, TeamHistory, $routeParams, $http, $rootScope) {
$scope.history = TeamHistory.query({ teamId: $routeParams.teamId });
@ -1395,6 +1405,11 @@ angular.module("FICApp")
});
}
})
.controller("TeamScoreController", function($scope, TeamScore, TeamMy, Exercice, $routeParams) {
$scope.scores = TeamScore.query({ teamId: $routeParams.teamId });
$scope.my = TeamMy.get({ teamId: $routeParams.teamId });
$scope.exercices = Exercice.query();
})
.controller("TeamStatsController", function($scope, TeamStats, $routeParams) {
$scope.teamstats = TeamStats.get({ teamId: $routeParams.teamId });
$scope.teamstats.$promise.then(function(res) {