My big initial commit to this repo and project.

This commit is contained in:
Brian McGonagill 2022-08-05 16:55:56 -05:00
parent 750811a81f
commit 8636f8cf9b
2433 changed files with 199488 additions and 1042 deletions

View file

@ -2,14 +2,32 @@
{{#if isInRole 'systemadmin'}}
<h3>User Management</h3>
<div class="row">
<div class="col s12 m6 l4 input-field" id="usersListCol">
</div>
<div class="col s12 m6 l4 input-field" id="userAssignedRoleCol">
</div>
<div class="col s12 m6 l4" id="assignRoleBtnCol">
<div class="col s12 m12 l12">
<table class="striped highlight responsive-table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each userInfo}}
<tr>
<td>{{userName}}</td>
<td>{{userEmail}}</td>
<td>{{userRole}}</td>
<td>
<div class="input-field">
<i class="material-icons clickable deleteUser">delete</i>
<i class="material-icons clickable editUser">edit</i>
</div>
</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/if}}

View file

@ -5,13 +5,37 @@ Template.userMgmt.onCreated(function() {
});
Template.userMgmt.onRendered(function() {
$('select').formSelect();
});
Template.userMgmt.helpers({
userInfo: function() {
return Meteor.users.find({});
},
userName: function() {
return this.profile.fullname;
},
userEmail: function() {
return this.emails[0].address;
},
userRole: function() {
return Roles.getRolesForUser( this._id );
}
});
Template.userMgmt.events({
"click .editUser" (event) {
event.preventDefault();
let userId = this._id;
// take action
console.log("Edit called on: " + userId);
},
"click .deleteUser" (event) {
event.preventDefault();
let userId = this._id;
// take action
console.log("Delete called on : " + userId);
}
});