mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-12 21:40:41 +00:00
36 lines
910 B
HTML
36 lines
910 B
HTML
{% set title = "Users" %}
|
|
{% extends "layout.html" %}
|
|
{% block content %}
|
|
|
|
<h3>Active users:</h3>
|
|
{{activeUsersTable|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>
|
|
|
|
<hr>
|
|
<h3>Inactive users:</h3>
|
|
{{inactiveUsersTable|safe}}
|
|
{% endblock content %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
let $table = $('#activeUsersTable')
|
|
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 %}
|