feat(login): recover-password section
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-09-14 15:18:11 +02:00
parent 5cff983d4c
commit cf7016c28a
8 changed files with 53 additions and 2 deletions

View File

@ -23,7 +23,7 @@ export default class Auth {
initialize() {
let criteria = {
to: state => state.name != 'login'
to: state => !state.name.includes('login')
};
this.$transitions.onStart(criteria, transition => {
if (this.loggedIn)

View File

@ -6,6 +6,7 @@ import './home/home';
import './layout';
import './left-menu/left-menu';
import './login/login';
import './login/recover-password';
import './module-card';
import './module-main';
import './side-menu/side-menu';

View File

@ -1,4 +1,5 @@
User: Usuario
Password: Contraseña
Do not close session: No cerrar sesión
Enter: Entrar
Enter: Entrar
I do not remember my password: No recuerdo mi contraseña

View File

@ -22,6 +22,11 @@
<div class="spinner-wrapper">
<vn-spinner enable="$ctrl.loading"></vn-spinner>
</div>
<div class="vn-pt-lg">
<a ui-sref="login.recover-password" translate>
I do not remember my password
</a>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,11 @@
<div class="box">
<img src="./logo.svg"/>
<form name="form" ng-submit="$ctrl.submit()">
<vn-textfield
label="User"
ng-model="$ctrl.user"
vn-id="userField"
vn-focus>
</vn-textfield>
</form>
</div>

View File

@ -0,0 +1,22 @@
import ngModule from '../../module';
import './style.scss';
/**
* A simple login form.
*/
export default class Controller {
constructor($, $element) {
Object.assign(this, {
$,
$element,
user: localStorage.getItem('lastUser'),
remember: true
});
}
}
Controller.$inject = ['$scope', '$element'];
ngModule.vnComponent('vnRecoverPassword', {
template: require('./recover-password.html'),
controller: Controller
});

View File

@ -71,4 +71,8 @@ vn-login {
box-shadow: none;
}
}
a{
color: $color-primary;
}
}

View File

@ -13,6 +13,13 @@ function config($stateProvider, $urlRouterProvider) {
login: {template: '<vn-login></vn-login>'}
}
})
.state('login.recover-password', {
url: '/recover-password',
description: 'Recover-password',
views: {
recoverPassword: {template: '<vn-recover-password></vn-recover-password>'}
}
})
.state('home', {
url: '/',
description: 'Home',