-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout d'une page de profil avec pour feature le changement de mot de …
…passe
- Loading branch information
1 parent
09caf38
commit 15c01c0
Showing
7 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
public/angularApp/app/feature/profile/controller/ProfileController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
angular.module('myVirtualStoryBookApp') | ||
.controller('ProfileController', function ($scope, $state, $location, $window, ConnectionService, PlayerService) { | ||
|
||
if ($location.protocol() != 'https'){ | ||
$window.location.href = $location.absUrl().replace('http', 'https'); | ||
}; | ||
|
||
$scope.state = 'init'; | ||
|
||
$scope.changePassword = function(passwords){ | ||
if($scope.loginForm.$valid){ | ||
$scope.state = 'sending'; | ||
ConnectionService.changePassword(passwords).success(function(player){ | ||
$scope.state = 'success'; | ||
}).error($scope._displayError); | ||
} | ||
} | ||
|
||
$scope._displayError = function(response){ | ||
$scope.displayMessage = true; | ||
$scope.state= 'error'; | ||
$scope.displayMessageText = response.message; | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="content-wrapper"> | ||
<section class="content-header"> | ||
<h1>Mon profil</h1> | ||
<ol class="breadcrumb"> | ||
<li><a ui-sref="app.play.books">MyVirtualStoryBook</a></li> | ||
<li class="active">Mon profil</li> | ||
</ol> | ||
</section> | ||
<!-- Main content --> | ||
<section class="content"> | ||
<!-- Default box --> | ||
<div class="row"> | ||
<div class="col-xs-6"> | ||
<div> | ||
<div class="box md-whiteframe-z1"> | ||
<div class="box-header"> | ||
<h3 class="box-title">Changer de mot de passe</h3> | ||
</div><!-- /.box-header --> | ||
<div class="box-body row"> | ||
<div class="col-xs-12"> | ||
<form name="loginForm"> | ||
<div class="input-group margin-top" style="width:100%"> | ||
<label>Nouveau mot de passe</label> | ||
<input type="password" max="20" name="new" class="form-control" placeholder="Nouveau mot de passe" ng-model="passwords.new" ng-change="displayMessage = false" required> | ||
</div> | ||
<div class="input-group margin-top" style="width:100%"> | ||
<label>Confirmation</label> | ||
<input type="password" max="20" name="confirmation" class="form-control" placeholder="Confirmation" ng-model="passwords.confirmation" ng-change="displayMessage = false" required> | ||
</div> | ||
<div class="input-group margin-top" style="width:100%"> | ||
<label>Ancien mot de passe</label> | ||
<input type="password" max="20" name="old" class="form-control" placeholder="Ancien mot de passe" ng-model="passwords.old" ng-change="displayMessage = false" required> | ||
</div> | ||
<div class="row margin-top"> | ||
<div class="col-xs-12"> | ||
<button ng-show="state === 'init'" style="width:100%" type="submit" ng-click="changePassword(passwords)" class="btn btn-primary">Changer de mot de passe</md-button> | ||
<button ng-show="state === 'sending'" disabled style="width:100%" type="submit" class="btn btn-warning">Verification<span class="fa fa-spinner fa-spin"></span></md-button> | ||
<button ng-show="state === 'success'" disabled style="width:100%" type="submit" class="btn btn-success">Mot de passe changé <span class="fa fa-check"></span></md-button> | ||
<button ng-show="state === 'error'" style="width:100%" type="submit" ng-click="changePassword(passwords)" class="btn btn-danger">{{displayMessageText}}</md-button> | ||
</div><!-- /.col --> | ||
</div> | ||
</form> | ||
</div> | ||
</div><!-- /.box-body --> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section><!-- /.content --> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters