feat(recover-password): create section and route
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Alex Moreno 2022-09-15 10:21:30 +02:00
parent cf7016c28a
commit 310557427a
6 changed files with 43 additions and 12 deletions

View File

@ -3,7 +3,11 @@
</vn-layout>
<ui-view
name="login"
ng-if="!$ctrl.showLayout">
ng-if="!$ctrl.showLayout && !$ctrl.isRecover">
</ui-view>
<ui-view
name="recover-password"
ng-if="!$ctrl.showLayout && $ctrl.isRecover">
</ui-view>
<vn-snackbar vn-id="snackbar"></vn-snackbar>
<vn-debug-info></vn-debug-info>

View File

@ -15,7 +15,12 @@ export default class App extends Component {
get showLayout() {
let state = this.$state.current.name;
return state && state != 'login';
return state && !state.includes('login');
}
get isRecover() {
let state = this.$state.current.name;
return state == 'login.recover-password';
}
$onDestroy() {

View File

@ -1,5 +1,8 @@
User: Usuario
Password: Contraseña
Email: Correo electrónico
Do not close session: No cerrar sesión
Enter: Entrar
I do not remember my password: No recuerdo mi contraseña
Recover password: Recuperar contraseña
We will sent you an email to recover your password: Te enviaremos un correo para restablecer tu contraseña

View File

@ -1,11 +1,21 @@
<div class="box">
<img src="./logo.svg"/>
<form name="form" ng-submit="$ctrl.submit()">
<h5 class="vn-mb-lg" translate>Recover password</h5>
<vn-textfield
label="User"
ng-model="$ctrl.user"
vn-id="userField"
label="Email"
ng-model="$ctrl.email"
vn-focus>
</vn-textfield>
<div
class="text-secondary"
translate>
We will sent you an email to recover your password
</div>
<div class="footer">
<vn-submit label="Recover password"></vn-submit>
<div class="spinner-wrapper">
<vn-spinner enable="$ctrl.loading"></vn-spinner>
</div>
</div>
</form>
</div>

View File

@ -1,6 +1,7 @@
@import "variables";
vn-login {
vn-login,
vn-recover-password{
position: absolute;
height: 100%;
width: 100%;
@ -61,6 +62,16 @@ vn-login {
}
}
}
h5{
color: $color-primary;
}
.text-secondary{
text-align: center;
padding-bottom: 16px;
}
}
@media screen and (max-width: 600px) {

View File

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