mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
32 lines
810 B
HTML
32 lines
810 B
HTML
{% set title = "Users" %}
|
|
{% extends "layout.html" %}
|
|
{% block content %}
|
|
|
|
{{table|safe}}
|
|
<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 a new user</button>
|
|
</form>
|
|
|
|
{% endblock content %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
let $table = $('#usersTab')
|
|
let $button = $('#deactivateUsersButton')
|
|
|
|
$(function() {
|
|
$button.click(function () {
|
|
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);
|
|
})
|
|
})
|
|
</script>
|
|
{% endblock scripts %}
|