Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 4658-createWorker

This commit is contained in:
Alex Moreno 2022-12-28 14:18:35 +01:00
commit 9ec5e1c53d
20 changed files with 216 additions and 173 deletions

View File

@ -5,10 +5,10 @@ import './descriptor-popover';
import './home/home'; import './home/home';
import './layout'; import './layout';
import './left-menu/left-menu'; import './left-menu/left-menu';
import './login/index'; import './login';
import './login/login'; import './outLayout';
import './login/recover-password'; import './recover-password';
import './login/reset-password'; import './reset-password';
import './module-card'; import './module-card';
import './module-main'; import './module-main';
import './side-menu/side-menu'; import './side-menu/side-menu';

View File

@ -1,6 +1,27 @@
<div class="box"> <vn-textfield
<img src="./logo.svg"/> label="User"
<form name="form"> ng-model="$ctrl.user"
<ui-view></ui-view> vn-id="userField"
</form> vn-focus>
</vn-textfield>
<vn-textfield
label="Password"
ng-model="$ctrl.password"
type="password">
</vn-textfield>
<vn-check
label="Do not close session"
ng-model="$ctrl.remember"
name="remember">
</vn-check>
<div class="footer">
<vn-submit label="Enter" ng-click="$ctrl.submit()"></vn-submit>
<div class="spinner-wrapper">
<vn-spinner enable="$ctrl.loading"></vn-spinner>
</div>
<div class="vn-pt-lg">
<a ui-sref="recover-password" translate>
I do not remember my password
</a>
</div>
</div> </div>

View File

@ -1,16 +1,43 @@
import ngModule from '../../module'; import ngModule from '../../module';
import Component from 'core/lib/component';
import './style.scss'; import './style.scss';
export default class OutLayout extends Component { /**
constructor($element, $scope) { * A simple login form.
super($element, $scope); */
export default class Controller {
constructor($, $element, vnAuth) {
Object.assign(this, {
$,
$element,
vnAuth,
user: localStorage.getItem('lastUser'),
remember: true
});
}
submit() {
this.loading = true;
this.vnAuth.login(this.user, this.password, this.remember)
.then(() => {
localStorage.setItem('lastUser', this.user);
this.loading = false;
})
.catch(err => {
this.loading = false;
this.password = '';
this.focusUser();
throw err;
});
}
focusUser() {
this.$.userField.select();
this.$.userField.focus();
} }
} }
Controller.$inject = ['$scope', '$element', 'vnAuth'];
OutLayout.$inject = ['$element', '$scope']; ngModule.vnComponent('vnLogin', {
ngModule.vnComponent('vnOutLayout', {
template: require('./index.html'), template: require('./index.html'),
controller: OutLayout controller: Controller
}); });

View File

@ -1,16 +1,5 @@
User: Usuario User: Usuario
Password: Contraseña Password: Contraseña
Email: Correo electrónico
Do not close session: No cerrar sesión Do not close session: No cerrar sesión
Enter: Entrar Enter: Entrar
I do not remember my password: No recuerdo mi contraseña 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
Notification sent!: ¡Notificación enviada!
Reset password: Restrablecer contraseña
New password: Nueva contraseña
Repeat password: Repetir contraseña
Password requirements: >
La contraseña debe tener al menos {{ length }} caracteres de longitud,
{{nAlpha}} caracteres alfabéticos, {{nUpper}} letras mayúsculas, {{nDigits}}
dígitos y {{nPunct}} símbolos (Ej: $%&.)

View File

@ -1,27 +0,0 @@
<vn-textfield
label="User"
ng-model="$ctrl.user"
vn-id="userField"
vn-focus>
</vn-textfield>
<vn-textfield
label="Password"
ng-model="$ctrl.password"
type="password">
</vn-textfield>
<vn-check
label="Do not close session"
ng-model="$ctrl.remember"
name="remember">
</vn-check>
<div class="footer">
<vn-submit label="Enter" ng-click="$ctrl.submit()"></vn-submit>
<div class="spinner-wrapper">
<vn-spinner enable="$ctrl.loading"></vn-spinner>
</div>
<div class="vn-pt-lg">
<a ui-sref="recover-password" translate>
I do not remember my password
</a>
</div>
</div>

View File

@ -1,43 +0,0 @@
import ngModule from '../../module';
import './style.scss';
/**
* A simple login form.
*/
export default class Controller {
constructor($, $element, vnAuth) {
Object.assign(this, {
$,
$element,
vnAuth,
user: localStorage.getItem('lastUser'),
remember: true
});
}
submit() {
this.loading = true;
this.vnAuth.login(this.user, this.password, this.remember)
.then(() => {
localStorage.setItem('lastUser', this.user);
this.loading = false;
})
.catch(err => {
this.loading = false;
this.password = '';
this.focusUser();
throw err;
});
}
focusUser() {
this.$.userField.select();
this.$.userField.focus();
}
}
Controller.$inject = ['$scope', '$element', 'vnAuth'];
ngModule.vnComponent('vnLogin', {
template: require('./login.html'),
controller: Controller
});

View File

@ -1,8 +1,6 @@
@import "variables"; @import "variables";
vn-login, vn-login{
vn-reset-password,
vn-recover-password{
.footer { .footer {
margin-top: 32px; margin-top: 32px;
text-align: center; text-align: center;
@ -24,69 +22,3 @@ vn-recover-password{
} }
} }
} }
vn-out-layout{
position: absolute;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
color: $color-font;
font-size: 1.1rem;
font-weight: normal;
background-color: $color-bg-dark;
display: flex;
justify-content: center;
align-items: center;
overflow: auto;
& > .box {
box-sizing: border-box;
position: absolute;
max-width: 304px;
min-width: 240px;
padding: 48px;
background-color: $color-bg-panel;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, .6);
border-radius: 8px;
& > img {
width: 100%;
padding-bottom: 16px;
}
& > form {
& > .vn-textfield {
width: 100%;
}
& > .vn-check {
display: block;
.md-label {
white-space: inherit;
}
}
}
h5{
color: $color-primary;
}
.text-secondary{
text-align: center;
padding-bottom: 16px;
}
}
@media screen and (max-width: 600px) {
background-color: $color-bg-panel;
& > .box {
padding: 16px;
box-shadow: none;
}
}
a{
color: $color-primary;
}
}

View File

@ -0,0 +1,6 @@
<div class="box">
<img src="./logo.svg"/>
<form name="form">
<ui-view></ui-view>
</form>
</div>

View File

@ -0,0 +1,16 @@
import ngModule from '../../module';
import Component from 'core/lib/component';
import './style.scss';
export default class OutLayout extends Component {
constructor($element, $scope) {
super($element, $scope);
}
}
OutLayout.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnOutLayout', {
template: require('./index.html'),
controller: OutLayout
});

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,67 @@
@import "variables";
vn-out-layout{
position: absolute;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
color: $color-font;
font-size: 1.1rem;
font-weight: normal;
background-color: $color-bg-dark;
display: flex;
justify-content: center;
align-items: center;
overflow: auto;
& > .box {
box-sizing: border-box;
position: absolute;
max-width: 304px;
min-width: 240px;
padding: 48px;
background-color: $color-bg-panel;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, .6);
border-radius: 8px;
& > img {
width: 100%;
padding-bottom: 16px;
}
& > form {
& > .vn-textfield {
width: 100%;
}
& > .vn-check {
display: block;
.md-label {
white-space: inherit;
}
}
}
h5{
color: $color-primary;
}
.text-secondary{
text-align: center;
padding-bottom: 16px;
}
}
@media screen and (max-width: 600px) {
background-color: $color-bg-panel;
& > .box {
padding: 16px;
box-shadow: none;
}
}
a{
color: $color-primary;
}
}

View File

@ -32,6 +32,6 @@ export default class Controller {
Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state']; Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state'];
ngModule.vnComponent('vnRecoverPassword', { ngModule.vnComponent('vnRecoverPassword', {
template: require('./recover-password.html'), template: require('./index.html'),
controller: Controller controller: Controller
}); });

View File

@ -0,0 +1,3 @@
Recover password: Recuperar contraseña
We will sent you an email to recover your password: Te enviaremos un correo para restablecer tu contraseña
Notification sent!: ¡Notificación enviada!

View File

@ -0,0 +1,24 @@
@import "variables";
vn-recover-password{
.footer {
margin-top: 32px;
text-align: center;
position: relative;
& > .vn-submit {
display: block;
& > input {
display: block;
width: 100%;
}
}
& > .spinner-wrapper {
position: absolute;
width: 0;
top: 3px;
right: -8px;
overflow: visible;
}
}
}

View File

@ -43,6 +43,6 @@ export default class Controller {
Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state', '$location']; Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state', '$location'];
ngModule.vnComponent('vnResetPassword', { ngModule.vnComponent('vnResetPassword', {
template: require('./reset-password.html'), template: require('./index.html'),
controller: Controller controller: Controller
}); });

View File

@ -1,7 +1,3 @@
User: User
Password: Password
Do not close session: Do not close session
Enter: Enter
Password requirements: > Password requirements: >
The password must have at least {{ length }} length characters, The password must have at least {{ length }} length characters,
{{nAlpha}} alphabetic characters, {{nUpper}} capital letters, {{nDigits}} {{nAlpha}} alphabetic characters, {{nUpper}} capital letters, {{nDigits}}

View File

@ -0,0 +1,8 @@
Reset password: Restrablecer contraseña
New password: Nueva contraseña
Repeat password: Repetir contraseñaç
Password changed!: ¡Contraseña cambiada!
Password requirements: >
La contraseña debe tener al menos {{ length }} caracteres de longitud,
{{nAlpha}} caracteres alfabéticos, {{nUpper}} letras mayúsculas, {{nDigits}}
dígitos y {{nPunct}} símbolos (Ej: $%&.)

View File

@ -0,0 +1,24 @@
@import "variables";
vn-reset-password{
.footer {
margin-top: 32px;
text-align: center;
position: relative;
& > .vn-submit {
display: block;
& > input {
display: block;
width: 100%;
}
}
& > .spinner-wrapper {
position: absolute;
width: 0;
top: 3px;
right: -8px;
overflow: visible;
}
}
}