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

72
public/js/app.js vendored
View File

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

View File

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