1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00
AdvLabDB/advlabdb/templates/users.html

33 lines
810 B
HTML
Raw Normal View History

{% set title = "Users" %}
{% extends "layout.html" %}
{% block content %}
2021-03-19 20:40:40 +00:00
{{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>
2021-03-19 20:40:40 +00:00
{% endblock content %}
{% block scripts %}
<script>
2021-04-17 15:14:23 +00:00
let $table = $('#usersTab')
let $button = $('#deactivateUsersButton')
$(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);
})
})
</script>
{% endblock scripts %}