SPRA-2 add admin; add user list; add user; change permissions
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
import $ from 'jquery';
|
||||
|
||||
export default class extends Controller {
|
||||
mainObj
|
||||
deleteButtons
|
||||
confirmModalObj
|
||||
confirmModalUsernameObj
|
||||
connect() {
|
||||
this.mainObj = $(".page.admin.users");
|
||||
this.deleteButtons = this.mainObj.find(".confirmRemoveUser");
|
||||
this.confirmModalObj = this.mainObj.find("#removeConfirmModal");
|
||||
this.confirmModalUsernameObj = this.confirmModalObj.find(".insertUsername");
|
||||
this.bindOnClick()
|
||||
}
|
||||
|
||||
bindOnClick() {
|
||||
this.deleteButtons.on("click", (e) => {
|
||||
const obj = $(e.currentTarget),
|
||||
username = $(obj).attr("data-username"),
|
||||
formLink = $(obj).attr("data-formlink");
|
||||
|
||||
this.confirmModalUsernameObj.html(username);
|
||||
this.confirmModalObj.find("form").attr("action", formLink);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user