Agregado boton para mostrar contraseña en login de admin

This commit is contained in:
Ale 2022-10-24 22:40:30 -03:00
parent 4da7ff2431
commit 3e426d088d
2 changed files with 91 additions and 37 deletions

100
public/js/app.js vendored
View File

@ -2211,6 +2211,7 @@ __webpack_require__.r(__webpack_exports__);
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'Login',
data: function data() {
return {
visible: false,
@ -2263,12 +2264,21 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({
name: "LoginAdmin.vue",
name: "LoginAdmin",
data: function data() {
return {
visible: false,
gdc: null
gdc: null,
passwordVisible: false,
passwordType: "password"
};
},
mounted: function mounted() {
@ -2278,6 +2288,12 @@ __webpack_require__.r(__webpack_exports__);
_this.gdc = gdc;
_this.visible = true;
});
},
methods: {
togglePassword: function togglePassword() {
if (this.passwordVisible) this.passwordType = "password";else this.passwordType = "text";
this.passwordVisible = !this.passwordVisible;
}
}
});
@ -4525,8 +4541,9 @@ var render = function () {
[_vm._v("Seleccionar")]
),
_vm._v(" "),
_vm._l(_vm.gdcs, function (gdc) {
_vm._l(_vm.gdcs, function (gdc, index) {
return _c("option", {
key: index,
attrs: { name: gdc.nombre + (_vm.isAdmin ? "_admin" : "") },
domProps: {
textContent: _vm._s(
@ -4953,36 +4970,56 @@ var render = function () {
],
staticClass: "block",
},
[_vm._m(0), _vm._v(" "), _vm._m(1)]
[
_c("div", { staticClass: "field" }, [
_c("label", { staticClass: "label has-text-white" }, [
_vm._v("Contraseña de administración del barrio"),
]),
_vm._v(" "),
_c("div", { staticClass: "field has-addons" }, [
_c("div", { staticClass: "control" }, [
_c("input", {
staticClass: "input",
attrs: {
required: "",
type: this.passwordType,
name: "password",
placeholder: "Contraseña de admin del barrio",
},
}),
]),
_vm._v(" "),
_c("div", { staticClass: "control" }, [
_c(
"a",
{
staticClass: "button is-warning",
on: { click: _vm.togglePassword },
},
[
_vm._v(
"\n\t\t\t\t\t\t" +
_vm._s(
(_vm.passwordVisible ? "Ocultar" : "Mostrar") +
" contraseña"
) +
" \n\t\t\t\t\t"
),
]
),
]),
]),
_vm._v(" "),
_c("p", { staticClass: "help has-text-white" }, [
_vm._v("Si no la sabés, consultá a la comisión informática."),
]),
]),
_vm._v(" "),
_vm._m(0),
]
)
}
var staticRenderFns = [
function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "field" }, [
_c("label", { staticClass: "label has-text-white" }, [
_vm._v("Contraseña de administración del barrio"),
]),
_vm._v(" "),
_c("p", { staticClass: "control" }, [
_c("input", {
staticClass: "input",
attrs: {
required: "",
type: "password",
name: "password",
placeholder: "Contraseña de admin del barrio",
},
}),
]),
_vm._v(" "),
_c("p", { staticClass: "help has-text-white" }, [
_vm._v("Si no la sabés, consultá a la comisión informática."),
]),
])
},
function () {
var _vm = this
var _h = _vm.$createElement
@ -5688,8 +5725,9 @@ var render = function () {
[_vm._v("Seleccionar")]
),
_vm._v(" "),
_vm._l(_vm.regiones, function (region) {
_vm._l(_vm.regiones, function (region, index) {
return _c("option", {
key: index,
attrs: { name: region },
domProps: { textContent: _vm._s(region) },
})

View File

@ -2,9 +2,16 @@
<div v-show="visible" class="block">
<div class="field">
<label class="label has-text-white">Contraseña de administración del barrio</label>
<p class="control">
<input required class="input" type="password" name="password" placeholder="Contraseña de admin del barrio">
</p>
<div class="field has-addons">
<div class="control">
<input required class="input" :type="this.passwordType" name="password" placeholder="Contraseña de admin del barrio">
</div>
<div class="control">
<a class="button is-warning" @click="togglePassword">
{{ (passwordVisible ? 'Ocultar' : 'Mostrar') + ' contraseña'}}
</a>
</div>
</div>
<p class="help has-text-white">Si no la sabés, consultá a la comisión informática.</p>
</div>
<div class="field">
@ -17,11 +24,13 @@
<script>
export default {
name: "LoginAdmin.vue",
name: "LoginAdmin",
data() {
return {
visible: false,
gdc: null
gdc: null,
passwordVisible: false,
passwordType: "password",
}
},
mounted() {
@ -29,7 +38,14 @@
this.gdc = gdc;
this.visible = true;
});
}
},
methods: {
togglePassword() {
if (this.passwordVisible) this.passwordType = "password";
else this.passwordType = "text"
this.passwordVisible = !this.passwordVisible
}
}
}
</script>