parent
16f16e8a15
commit
31a8a0fba4
7 changed files with 76 additions and 11 deletions
|
@ -39,16 +39,24 @@
|
|||
</h6>
|
||||
</div>
|
||||
<div id="collapseForgot" class="panel-collapse collapse out">
|
||||
<div class="quay-spinner" ng-show="sendingRecovery"></div>
|
||||
<div style="text-align: center" ng-show="sendingRecovery">
|
||||
<div class="cor-loader-inline"></div>
|
||||
</div>
|
||||
<div class="panel-body" ng-show="!sendingRecovery">
|
||||
<form class="form-signin" ng-submit="sendRecovery();">
|
||||
<form class="form-signin" ng-submit="sendRecovery()" ng-show="!sent">
|
||||
<input type="text" class="form-control input-lg" placeholder="Email" ng-model="recovery.email">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Send Recovery Email</button>
|
||||
</form>
|
||||
|
||||
<div class="alert alert-danger" ng-show="invalidRecovery">{{errorMessage}}</div>
|
||||
|
||||
<div class="alert alert-success" ng-show="sent">Account recovery email was sent.</div>
|
||||
<div class="co-alert co-alert-danger" ng-show="invalidRecovery">{{errorMessage}}</div>
|
||||
<div class="co-alert co-alert-info" ng-show="sent.status == 'org'">
|
||||
The e-mail address <code>{{ sent.orgemail }}</code> is assigned to organization <code>{{ sent.orgname }}</code>.
|
||||
To access that organization, an admin user must be used.
|
||||
<br><br>
|
||||
An e-mail has been sent to
|
||||
<code>{{ sent.orgemail }}</code> with the full list of admin users.
|
||||
</div>
|
||||
<div class="co-alert co-alert-success" ng-show="sent.status == 'sent'">Account recovery email was sent.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -24,15 +24,15 @@ angular.module('quay').directive('userSetup', function () {
|
|||
$scope.sendRecovery = function() {
|
||||
$scope.sendingRecovery = true;
|
||||
|
||||
ApiService.requestRecoveryEmail($scope.recovery).then(function() {
|
||||
ApiService.requestRecoveryEmail($scope.recovery).then(function(resp) {
|
||||
$scope.invalidRecovery = false;
|
||||
$scope.errorMessage = '';
|
||||
$scope.sent = true;
|
||||
$scope.sent = resp;
|
||||
$scope.sendingRecovery = false;
|
||||
}, function(resp) {
|
||||
$scope.invalidRecovery = true;
|
||||
$scope.errorMessage = ApiService.getErrorMessage(resp, 'Cannot send recovery email');
|
||||
$scope.sent = false;
|
||||
$scope.sent = null;
|
||||
$scope.sendingRecovery = false;
|
||||
});
|
||||
};
|
||||
|
|
Reference in a new issue