Skip to content

Commit

Permalink
Confirmation pages ported over (confirmation, lounge, recovery)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamaziz15 committed Oct 2, 2017
1 parent 5ef8f09 commit 33f6872
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 381 deletions.
1 change: 1 addition & 0 deletions src/app/index.default-config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ angular.module('mnoEnterprise.defaultConfiguration', [])
.constant('APP_NAME', null)
.constant('INTERCOM_ID', null)
.constant('URL_CONFIG', {})
.constant('DEVISE_CONFIG', {})
8 changes: 8 additions & 0 deletions src/app/index.route.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ angular.module 'mnoEnterpriseAngular'
controller: 'AuthConfirmCtrl'
controllerAs: 'vm'
public: true
.state 'confirmation_recovery',
data:
pageTitle: 'ConfirmationRecovery'
url: '/confirmation/new'
templateUrl: 'app/views/auth/confirmation/new.html'
controller: 'AuthConfirmRecoveryCtrl'
controllerAs: 'vm'
public: true
.state 'password_recovery',
data:
pageTitle: 'PasswordRecovery'
Expand Down
4 changes: 0 additions & 4 deletions src/app/stylesheets/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@

@login-box-bg-color: @bg-inverse-color;
@login-box-padding: 20px;
<<<<<<< HEAD
@login-box-brand-logo: { max-width: 300px; max-height: 200px; margin: 16px auto 16px auto; };
=======
@login-box-brand-logo-img: "../images/main-logo.png";
@login-box-brand-logo: { min-height: 61px; max-width: 160px; max-height: 130px; margin: 17px auto 5px auto; };
>>>>>>> Move login page to SPA - WIP
@login-box-btn-login: { width: 100%; };

@login-box-sso-intuit-logo: "../images/logo-intuit.png";
Expand Down
374 changes: 0 additions & 374 deletions src/app/views/auth/confirmation/confirm_original.html

This file was deleted.

16 changes: 16 additions & 0 deletions src/app/views/auth/confirmation/new.controller.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
angular.module 'mnoEnterpriseAngular'
.controller('AuthConfirmRecoveryCtrl',
($state, $stateParams, MnoeAuthSvc, toastr, MnoErrorsHandler) ->
vm = @
vm.user = {}

vm.resendConfirmation = ->
MnoeAuthSvc.all('/users/confirmation').post({user: vm.user}).then(
->
toastr.info('If your email address exists in our database and is unconfirmed, you will receive an email with instructions in a few minutes.')
$state.go('login')
->
toastr.error('Your request was unsuccessful, please try again or contact your platform administrator.')
)
return
)
39 changes: 39 additions & 0 deletions src/app/views/auth/confirmation/new.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div>
<div class='registration'>
<div class='container'>
<div class='row'>
<div class='login-box-wrapper'>
<div class='login-box-title'>
<h2>Confirmation</h2>
</div>
<div class='login-box'>
<div class='brand-logo'></div>
<form name="vm.form" class="form-horizontal autofill-detect" id="new_user" ng-submit="vm.resendConfirmation()">
<div class='row'>
<div class='col-sm-12'>
<input placeholder="*Email" autofocus="autofocus" required="required" ng-model="vm.user.email" class="form-control" type="email" name="user[email]" id="user_email" />
</div>
</div>
<br>
<div class='row'>
<div class='col-sm-12'>
<div class='text-center'>
<button class='btn btn-warning' ng-click='vm.hasClicked = true' ng-disabled='vm.form.$invalid' ng-hide='vm.hasClicked' type='submit'>Resend confirmation instructions</button>
<img ng-show='vm.hasClicked' class='loader'>
</div>
</div>
</div>
</form>
<hr>
<a ui-sref="login">{{'mno_enterprise.auth.shared.links.login' | translate}}</a>
<br>
<a ui-sref="signup">{{'mno_enterprise.auth.shared.links.signup' | translate}}</a>
<br>
<a ui-sref="password_recovery">{{'mno_enterprise.auth.shared.links.recover_password' | translate}}</a>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/app/views/auth/login/login.controller.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module 'mnoEnterpriseAngular'
.controller('AuthLoginCtrl',
(Auth, toastr, $state) ->
(Auth, toastr, $state, DEVISE_CONFIG) ->
vm = @

vm.login = ->
Expand All @@ -13,4 +13,4 @@ angular.module 'mnoEnterpriseAngular'
).finally(-> vm.hasClicked = false)

return
)
)
4 changes: 3 additions & 1 deletion src/app/views/auth/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ <h2>{{'mno_enterprise.auth.sessions.new.title' | translate}}</h2>
<br>
<a ui-sref="password_recovery">{{'mno_enterprise.auth.shared.links.recover_password' | translate}}</a>
<br>
<a href="/mnoe/auth/users/confirmation/new">{{'mno_enterprise.auth.shared.links.resend_confirmation' | translate}}</a>
<a ui-sref="confirmation_recovery">{{'mno_enterprise.auth.shared.links.resend_confirmation' | translate}}</a>
<br>
<a href="">{{'mno_enterprise.auth.shared.links.unlock' | translate}}</a>
<br>
</div>
</div>
Expand Down

0 comments on commit 33f6872

Please sign in to comment.