mirror of https://github.com/requarks/wiki
parent
0809946914
commit
ec6f32d29c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
// Vue Delete User instance
|
||||||
|
|
||||||
|
let vueDeleteUser = new Vue({
|
||||||
|
el: '#modal-admin-users-delete',
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open: (ev) => {
|
||||||
|
$('#modal-admin-users-delete').addClass('is-active');
|
||||||
|
},
|
||||||
|
cancel: (ev) => {
|
||||||
|
$('#modal-admin-users-delete').removeClass('is-active');
|
||||||
|
},
|
||||||
|
deleteUser: (ev) => {
|
||||||
|
vueDeleteUser.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-deluser-prompt').on('click', vueDeleteUser.open);
|
@ -1,6 +1,50 @@
|
|||||||
|
|
||||||
if($('#page-type-admin').length) {
|
if($('#page-type-admin-users').length) {
|
||||||
|
|
||||||
//=include ../modals/admin-createuser.js
|
//=include ../modals/admin-users-create.js
|
||||||
|
|
||||||
|
} else if($('#page-type-admin-users-edit').length) {
|
||||||
|
|
||||||
|
let vueEditUser = new Vue({
|
||||||
|
el: '#page-type-admin-users-edit',
|
||||||
|
data: {
|
||||||
|
id: '',
|
||||||
|
email: '',
|
||||||
|
password: '********',
|
||||||
|
name: '',
|
||||||
|
rights: [],
|
||||||
|
roleoverride: 'none'
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addRightsRow: (ev) => {
|
||||||
|
vueEditUser.rights.push({});
|
||||||
|
},
|
||||||
|
removeRightsRow: (ev) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
saveUser: (ev) => {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created: function() {
|
||||||
|
|
||||||
|
this.id = usrData._id;
|
||||||
|
this.email = usrData.email;
|
||||||
|
this.name = usrData.name;
|
||||||
|
|
||||||
|
console.log(_.find(usrData.rights, { role: 'admin' }));
|
||||||
|
|
||||||
|
if(_.find(usrData.rights, { role: 'admin' })) {
|
||||||
|
this.rights = _.reject(usrData.rights, ['role', 'admin']);
|
||||||
|
this.roleoverride = 'admin';
|
||||||
|
} else {
|
||||||
|
this.rights = usrData.rights;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//=include ../modals/admin-users-delete.js
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
.modal#modal-admin-users-delete
|
||||||
|
.modal-background
|
||||||
|
.modal-container
|
||||||
|
.modal-content
|
||||||
|
header.is-red Delete User Account?
|
||||||
|
section
|
||||||
|
span Are you sure you want to delete this user account? This action cannot be undone!
|
||||||
|
footer
|
||||||
|
a.button.is-grey.is-outlined(v-on:click="cancel") Abort
|
||||||
|
a.button.is-red(v-on:click="deleteUser") Delete
|
Loading…
Reference in new issue