frontend: fix angular syntax error
This commit is contained in:
parent
f4c3f9b511
commit
108814b8b7
@ -493,7 +493,6 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||||||
return cur.firstname.capitalize() + " " + cur.lastname.capitalize();
|
return cur.firstname.capitalize() + " " + cur.lastname.capitalize();
|
||||||
}).join(", ");
|
}).join(", ");
|
||||||
}
|
}
|
||||||
$scope.newName = "";
|
|
||||||
$rootScope.message = "";
|
$rootScope.message = "";
|
||||||
$rootScope.sberr = "";
|
$rootScope.sberr = "";
|
||||||
|
|
||||||
@ -501,17 +500,17 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||||||
|
|
||||||
$scope.tsubmit = function() {
|
$scope.tsubmit = function() {
|
||||||
$rootScope.sberr = "";
|
$rootScope.sberr = "";
|
||||||
if ($scope.newName.length < 1) {
|
if ($scope.my.newName.length < 1) {
|
||||||
$rootScope.messageClass = {"text-danger": true};
|
$rootScope.messageClass = {"text-danger": true};
|
||||||
$rootScope.sberr = "Nom d'équipe invalide: pas d'entrée.";
|
$rootScope.sberr = "Nom d'équipe invalide: pas d'entrée.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ($scope.newName.length > 32) {
|
else if ($scope.my.newName.length > 32) {
|
||||||
$rootScope.messageClass = {"text-danger": true};
|
$rootScope.messageClass = {"text-danger": true};
|
||||||
$rootScope.sberr = "Nom d'équipe invalide: pas plus de 32 caractères.";
|
$rootScope.sberr = "Nom d'équipe invalide: pas plus de 32 caractères.";
|
||||||
return false;
|
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.messageClass = {"text-danger": true};
|
||||||
$rootScope.sberr = "Nom d'équipe invalide: seuls les caractères alpha-numériques sont autorisés.";
|
$rootScope.sberr = "Nom d'équipe invalide: seuls les caractères alpha-numériques sont autorisés.";
|
||||||
return false;
|
return false;
|
||||||
@ -520,7 +519,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||||||
$http({
|
$http({
|
||||||
url: "/submit/name",
|
url: "/submit/name",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {newName: $scope.newName}
|
data: {newName: $scope.my.newName}
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
$rootScope.messageClass = {"text-success": true};
|
$rootScope.messageClass = {"text-success": true};
|
||||||
$rootScope.message = response.data.errmsg;
|
$rootScope.message = response.data.errmsg;
|
||||||
@ -528,7 +527,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||||||
var checkDiff = function() {
|
var checkDiff = function() {
|
||||||
$http.get("/my.json").then(function(response) {
|
$http.get("/my.json").then(function(response) {
|
||||||
if ($scope.my.name != response.data.name) {
|
if ($scope.my.name != response.data.name) {
|
||||||
$scope.newName = "";
|
$scope.my.newName = undefined;
|
||||||
$rootScope.message = "";
|
$rootScope.message = "";
|
||||||
$rootScope.recvMy(response.data);
|
$rootScope.recvMy(response.data);
|
||||||
$rootScope.refreshTeams();
|
$rootScope.refreshTeams();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<ul class="list-group" ng-if="my.members.length">
|
<ul class="list-group" ng-if="my.members.length">
|
||||||
<li class="list-group-item" ng-repeat="member in my.members">
|
<li class="list-group-item" ng-repeat="member in my.members">
|
||||||
{{ member.firstname | capitalize }}
|
{{ member.firstname | capitalize }}
|
||||||
<span style="font-style: italic" ng-if="{{ member.nickname }}">{{ member.nickname }}</span>
|
<span style="font-style: italic" ng-if="member.nickname">{{ member.nickname }}</span>
|
||||||
<span style="font-variant: small-caps;">{{ member.lastname | capitalize }}</span>
|
<span style="font-variant: small-caps;">{{ member.lastname | capitalize }}</span>
|
||||||
<span ng-if="member.company">- {{ member.company}}</span>
|
<span ng-if="member.company">- {{ member.company}}</span>
|
||||||
</li>
|
</li>
|
||||||
@ -22,14 +22,13 @@
|
|||||||
<label for="newName" class="col col-form-label">Nouveau nom</label>
|
<label for="newName" class="col col-form-label">Nouveau nom</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" id="newName" ng-model="newName" placeholder="{{ my.name }}">
|
<input type="text" class="form-control" id="newName" ng-model="my.newName" placeholder="{{ my.name }}">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button type="submit" class="btn btn-info">Valider</button>
|
<button type="submit" class="btn btn-info">Valider</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user