diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 5b57d32d..6705ded0 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -29,6 +29,14 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"]) controller: "TeamsListController", templateUrl: "views/team-list.html" }) + .when("/teams/new", { + controller: "TeamNewController", + templateUrl: "views/team-new.html" + }) + .when("/teams/print", { + controller: "TeamsListController", + templateUrl: "views/team-print.html" + }) .when("/teams/:teamId", { controller: "TeamController", templateUrl: "views/team-edit.html" @@ -37,10 +45,6 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"]) controller: "TeamController", templateUrl: "views/team-stats.html" }) - .when("/teams/new", { - controller: "TeamNewController", - templateUrl: "views/team-new.html" - }) .when("/public", { controller: "PublicController", templateUrl: "views/public.html" @@ -521,14 +525,30 @@ angular.module("FICApp") $location.url("/teams/" + id); }; }) - .controller("TeamMembersController", function($scope, TeamMember, $routeParams) { + .controller("TeamMembersController", function($scope, TeamMember) { $scope.fields = ["firstname", "lastname", "nickname", "company"]; + if ($scope.team != null) { + $scope.members = TeamMember.query({ teamId: $scope.team.id }); + $scope.newMember = function() { + $scope.members.push(new TeamMember()); + } + $scope.saveTeamMembers = function() { + if (this.team.id) { + TeamMember.save({ teamId: this.team.id }, $scope.members); + } + } + $scope.removeMember = function(member) { + angular.forEach($scope.members, function(m, k) { + if (member == m) + $scope.members.splice(k, 1); + }); + } + } }) .controller("TeamController", function($scope, $location, Team, TeamMember, $routeParams) { $scope.team = Team.get({ teamId: $routeParams.teamId }); $scope.fields = ["name", "color"]; - $scope.members = TeamMember.query({ teamId: $routeParams.teamId }); $scope.saveTeam = function() { if (this.team.id) { @@ -545,20 +565,6 @@ angular.module("FICApp") $scope.showStats = function() { $location.url("/teams/" + $scope.team.id + "/stats"); } - $scope.newMember = function() { - $scope.members.push(new TeamMember()); - } - $scope.saveTeamMembers = function() { - if (this.team.id) { - TeamMember.save({ teamId: this.team.id }, $scope.members); - } - } - $scope.removeMember = function(member) { - angular.forEach($scope.members, function(m, k) { - if (member == m) - $scope.members.splice(k, 1); - }); - } }) .controller("TeamStatsController", function($scope, TeamStats, $routeParams) { $scope.teamstats = TeamStats.get({ teamId: $routeParams.teamId }); diff --git a/admin/static/views/team-edit.html b/admin/static/views/team-edit.html index 64f96774..4fdf8064 100644 --- a/admin/static/views/team-edit.html +++ b/admin/static/views/team-edit.html @@ -1,4 +1,11 @@ -

{{ team.name }} ({{ team.initialName}}) et , {{ member.firstname | capitalize }} {{ member.nickname }} {{ member.lastname | capitalize }} Statistiques

+

+ {{ team.name }} + ({{ team.initialName}}) + + + Statistiques + +

@@ -31,10 +38,13 @@
- +

Membres Add member

-
+
+ This team has no member! +
+
diff --git a/admin/static/views/team-list.html b/admin/static/views/team-list.html index 2c0cea97..6ca0a0c7 100644 --- a/admin/static/views/team-list.html +++ b/admin/static/views/team-list.html @@ -1,4 +1,8 @@ -

Équipes Ajouter une équipe

+

+ Équipes + Ajouter une équipe + Imprimer les équipes +

diff --git a/admin/static/views/team-print.html b/admin/static/views/team-print.html new file mode 100644 index 00000000..86e54f4e --- /dev/null +++ b/admin/static/views/team-print.html @@ -0,0 +1,32 @@ +

{{ config.title }} – Équipes

+ +

+ +
+ + + + + + + + + + + + +
+ {{ field }} + + members +
+ {{ team[field] }} + + + + + +
+ {{ member[field] }} +
+