From 024ae04f4565e028173ea18754c1440516d5b442 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 17 Jan 2019 13:51:44 +0100 Subject: [PATCH] admin: new page to see score details --- admin/static/js/app.js | 15 ++++++++++++ admin/static/views/team-edit.html | 7 ++++-- admin/static/views/team-score.html | 39 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 admin/static/views/team-score.html diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 64baef5f..d725b113 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -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) { diff --git a/admin/static/views/team-edit.html b/admin/static/views/team-edit.html index f79baa51..62002ac8 100644 --- a/admin/static/views/team-edit.html +++ b/admin/static/views/team-edit.html @@ -1,6 +1,9 @@

{{ team.name }} - + @@ -98,7 +101,7 @@ - {{ row.time | date:"mediumTime" }}
{{ row.kind }} + {{ row.time | date:"mediumTime" }}
{{ row.kind }} diff --git a/admin/static/views/team-score.html b/admin/static/views/team-score.html new file mode 100644 index 00000000..8b151213 --- /dev/null +++ b/admin/static/views/team-score.html @@ -0,0 +1,39 @@ +

+ {{ team.name }} + Détails des scores +

+ +

+ + + + + + + + + + + + + + + + + + + + + + +
ExerciceRaisonPointsCalculDate
+ {{ exercice.title }} + + {{ row.reason }} + + {{ row.points * row.coeff }} + + {{ row.points }} * {{ row.coeff }} + + {{ row.time | date:"mediumTime" }} +
{{ my.score }}