frontend: fix angular syntax error
This commit is contained in:
parent
f4c3f9b511
commit
108814b8b7
2 changed files with 7 additions and 9 deletions
|
@ -493,7 +493,6 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
return cur.firstname.capitalize() + " " + cur.lastname.capitalize();
|
||||
}).join(", ");
|
||||
}
|
||||
$scope.newName = "";
|
||||
$rootScope.message = "";
|
||||
$rootScope.sberr = "";
|
||||
|
||||
|
@ -501,17 +500,17 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
|
||||
$scope.tsubmit = function() {
|
||||
$rootScope.sberr = "";
|
||||
if ($scope.newName.length < 1) {
|
||||
if ($scope.my.newName.length < 1) {
|
||||
$rootScope.messageClass = {"text-danger": true};
|
||||
$rootScope.sberr = "Nom d'équipe invalide: pas d'entrée.";
|
||||
return false;
|
||||
}
|
||||
else if ($scope.newName.length > 32) {
|
||||
else if ($scope.my.newName.length > 32) {
|
||||
$rootScope.messageClass = {"text-danger": true};
|
||||
$rootScope.sberr = "Nom d'équipe invalide: pas plus de 32 caractères.";
|
||||
return false;
|
||||
}
|
||||
else if (!$scope.newName.match(/^[A-Za-z0-9 àéèêëîïôùûü_-]+$/)) {
|
||||
else if (!$scope.my.newName.match(/^[A-Za-z0-9 àéèêëîïôùûü_-]+$/)) {
|
||||
$rootScope.messageClass = {"text-danger": true};
|
||||
$rootScope.sberr = "Nom d'équipe invalide: seuls les caractères alpha-numériques sont autorisés.";
|
||||
return false;
|
||||
|
@ -520,7 +519,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
$http({
|
||||
url: "/submit/name",
|
||||
method: "POST",
|
||||
data: {newName: $scope.newName}
|
||||
data: {newName: $scope.my.newName}
|
||||
}).then(function(response) {
|
||||
$rootScope.messageClass = {"text-success": true};
|
||||
$rootScope.message = response.data.errmsg;
|
||||
|
@ -528,7 +527,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
var checkDiff = function() {
|
||||
$http.get("/my.json").then(function(response) {
|
||||
if ($scope.my.name != response.data.name) {
|
||||
$scope.newName = "";
|
||||
$scope.my.newName = undefined;
|
||||
$rootScope.message = "";
|
||||
$rootScope.recvMy(response.data);
|
||||
$rootScope.refreshTeams();
|
||||
|
|
Reference in a new issue