mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
fix settings page delete user function
This commit is contained in:
parent
ee82dafb7c
commit
477e583be9
@ -125,7 +125,7 @@
|
||||
{{ wtf.render_field(update_account_information_form.username, material_icon='person') }}
|
||||
{{ wtf.render_field(update_account_information_form.email, material_icon='email') }}
|
||||
<div class="right-align">
|
||||
<a class="btn red waves-effect waves-light modal-trigger" href="#delete-user"><i class="material-icons left">delete</i>Delete</a>
|
||||
<a class="btn red waves-effect waves-light modal-trigger" href="#delete-user-modal"><i class="material-icons left">delete</i>Delete</a>
|
||||
{{ wtf.render_field(update_account_information_form.submit, material_icon='send') }}
|
||||
</div>
|
||||
</form>
|
||||
@ -184,7 +184,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="delete-user">
|
||||
<div class="modal" id="delete-user-modal">
|
||||
<div class="modal-content">
|
||||
<h4>Confirm User deletion</h4>
|
||||
<p>Do you really want to delete the User <b>{{ user.username }}</b>?</p>
|
||||
@ -204,7 +204,6 @@
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script>
|
||||
let deleteAvatarButtonElement = document.querySelector('#delete-avatar');
|
||||
let avatarPreviewElement = document.querySelector('#update-avatar-form-avatar-preview');
|
||||
let avatarUploadElement = document.querySelector('#update-avatar-form-avatar');
|
||||
|
||||
@ -213,7 +212,7 @@ avatarUploadElement.addEventListener('change', () => {
|
||||
avatarPreviewElement.src = URL.createObjectURL(file);
|
||||
});
|
||||
|
||||
deleteAvatarButtonElement.addEventListener('click', () => {
|
||||
document.querySelector('#delete-avatar').addEventListener('click', () => {
|
||||
Requests.users.entity.settings.avatar.delete({{ user.hashid|tojson }})
|
||||
.then(
|
||||
(response) => {
|
||||
|
Loading…
Reference in New Issue
Block a user