2021-03-18 22:20:59 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block content %}
|
2021-03-19 20:40:40 +00:00
|
|
|
|
|
|
|
{{table|safe}}
|
2021-04-17 00:19:38 +00:00
|
|
|
<div>
|
|
|
|
<button id="deactivateUsersButton" class="btn btn-warning">Deactivate users</button>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<form method="post">
|
|
|
|
<button type="submit" name="registerUser" class="btn btn-primary">Register user</button>
|
|
|
|
</form>
|
2021-03-19 20:40:40 +00:00
|
|
|
|
2021-03-18 22:20:59 +00:00
|
|
|
{% endblock content %}
|
2021-04-17 00:19:38 +00:00
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script>
|
2021-04-17 15:14:23 +00:00
|
|
|
let $table = $('#usersTab')
|
|
|
|
let $button = $('#deactivateUsersButton')
|
2021-04-17 00:19:38 +00:00
|
|
|
|
|
|
|
$(function() {
|
|
|
|
$button.click(function () {
|
2021-04-17 15:14:23 +00:00
|
|
|
let users = $table.bootstrapTable('getSelections');
|
|
|
|
let emails = [];
|
|
|
|
for (var i=0; i<users.length; i++) {
|
|
|
|
emails.push(users[i]["email"])
|
|
|
|
}
|
|
|
|
window.location.href = '{{url_for("deactivate_users")}}?json=' + JSON.stringify(emails);
|
2021-04-17 00:19:38 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
{% endblock scripts %}
|