mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
Updated user management and modal for password change.
This commit is contained in:
parent
17b42b7d68
commit
df3eb4ff08
5 changed files with 31 additions and 28 deletions
|
|
@ -1,25 +1,24 @@
|
|||
<template name="userInfoModal">
|
||||
<div id="userInfoModal" class="modal">
|
||||
<div id="userInfoModal" class="modal modal-fixed-footer">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col s12 m12 12">
|
||||
<h4>Password Reset</h4>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col s12 m6 l6 input-field">
|
||||
<input type="password" class="newPass" id="newPass" />
|
||||
<label for="newPass">Enter New Password</label>
|
||||
</div>
|
||||
<div class="col s12 m6 l6 input-field">
|
||||
<input type="password" class="newPassConf" style="{{#if $eq passMatch false}}background: red;{{/if}}" id="newPassConf" />
|
||||
<label for="newPassConf">Enter New Password</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" id="closePass" class="modal-close waves-effect waves-orange btn-flat white-text">Cancel</a>
|
||||
<a href="#" id="chPass" class="waves-effect waves-green btn-flat white-text">change Password</a>
|
||||
<div>
|
||||
<h4>Password Reset</h4>
|
||||
</div>
|
||||
<form class="row" style="gap: 1em;">
|
||||
<div class="col s12 m6 l6 input-field outlined">
|
||||
<input type="password" class="newPass" id="newPass" />
|
||||
<label for="newPass">Enter New Password</label>
|
||||
</div>
|
||||
<div class="col s12 m6 l6 input-field outlined">
|
||||
<input type="password" class="newPassConf {{#if $eq passMatch false}}red lighten-3{{/if}}" id="newPassConf" />
|
||||
<label for="newPassConf">Enter New Password</label>
|
||||
{{#if $eq passMatch false}}<p class="red-text">Passwords do not match!</p>{{/if}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="modal-close btn waves-effect waves-light filled orange white-text">Cancel</a>
|
||||
<a id="chPass" class="btn waves-effect waves-light filled green white-text modal-close">Change Password</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import { M } from '../../lib/assets/materialize.js';
|
||||
|
||||
Template.userInfoModal.onCreated(function() {
|
||||
|
||||
});
|
||||
|
|
@ -5,7 +7,8 @@ Template.userInfoModal.onCreated(function() {
|
|||
Template.userInfoModal.onRendered(function() {
|
||||
Session.set("passMatch", true);
|
||||
Session.set("passErr", false);
|
||||
$('.modal').modal();
|
||||
var elems = document.querySelectorAll('.modal');
|
||||
var instances = M.Modal.init(elems, {});
|
||||
});
|
||||
|
||||
Template.userInfoModal.helpers({
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
<td>{{userRole}}</td>
|
||||
<td>
|
||||
<div class="input-field">
|
||||
<i class="material-icons modal-trigger clickable deleteUser">delete</i>
|
||||
<i class="material-icons clickable editUser">edit</i>
|
||||
<i class="material-icons modal-trigger clickable deleteUser" data-target="modalDelete">delete</i>
|
||||
<i class="material-icons clickable editUser modal-trigger" data-target="userInfoModal">edit</i>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
|
||||
import { M } from '../../lib/assets/materialize.js';
|
||||
|
||||
Template.userMgmt.onCreated(function() {
|
||||
this.subscribe("userList");
|
||||
});
|
||||
|
||||
Template.userMgmt.onRendered(function() {
|
||||
$('select').formSelect();
|
||||
$('.modal').modal();
|
||||
var elems = document.querySelectorAll('select');
|
||||
var instances = M.FormSelect.init(elems, {});
|
||||
|
||||
var elemm = document.querySelectorAll('.modal');
|
||||
var instancem = M.Modal.init(elemm, {});;
|
||||
});
|
||||
|
||||
Template.userMgmt.helpers({
|
||||
|
|
@ -31,7 +34,6 @@ Template.userMgmt.events({
|
|||
let userId = this._id;
|
||||
// take action
|
||||
Session.set("usersId", userId);
|
||||
$("#userInfoModal").modal('open');
|
||||
},
|
||||
"click .deleteUser" (event) {
|
||||
event.preventDefault();
|
||||
|
|
@ -43,6 +45,5 @@ Template.userMgmt.events({
|
|||
Session.set("item", "User");
|
||||
Session.set("view", "Users");
|
||||
Session.set("method", "delete.userFromSys");
|
||||
$('#modalDelete').modal('open');
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue