2021-03-07 22:19:44 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Tokens</title>
|
2021-03-07 23:05:26 +00:00
|
|
|
|
|
|
|
<script src="../static/jquery-3.6.0.js"></script>
|
2021-03-07 22:19:44 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
{% with messages = get_flashed_messages() %}
|
|
|
|
{% if messages %}
|
|
|
|
<ul class=flashes>
|
|
|
|
{% for message in messages %}
|
|
|
|
<li>{{ message }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
|
|
|
<table border="1">
|
|
|
|
<td>Token</td>
|
|
|
|
<td>NutzerIn</td>
|
|
|
|
<td>Organisation</td>
|
|
|
|
<td>E-Mail</td>
|
|
|
|
<td>Gültig bis</td>
|
|
|
|
<td>Aktionen</td>
|
|
|
|
{% for t, data in assigned_tokens.items() %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ t }}</td>
|
|
|
|
{% for field in ['name', 'organization', 'email', 'valid_thru'] %}
|
|
|
|
<td>{{ data[field] if data[field] }}</td>
|
|
|
|
{% endfor %}
|
|
|
|
<td>
|
|
|
|
<a href="{{ url_for('edit_token', token=t) }}"><img src="static/edit.png" title="Editieren" alt="Edit"></a>
|
|
|
|
<a href="{{ url_for('deactivate_token', token=t) }}"><img src="static/stop.png" title="Deaktivieren" alt="Deactivate"></a>
|
2021-03-07 23:05:26 +00:00
|
|
|
<img src="static/delete.png" title="Löschen" alt="Delete" onclick="confirmDelete('{{ t }}')">
|
2021-03-07 22:19:44 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% for t, data in inactive_tokens.items() %}
|
|
|
|
<tr style="background-color: lightgrey">
|
|
|
|
<td>{{ t }}</td>
|
|
|
|
{% for field in ['name', 'organization', 'email', 'valid_thru'] %}
|
|
|
|
<td>{{ data[field] if data[field] }}</td>
|
|
|
|
{% endfor %}
|
|
|
|
<td>
|
|
|
|
<a href="{{ url_for('edit_token', token=t) }}"><img src="static/edit.png" title="Editieren" alt="Edit"></a>
|
2021-03-07 23:05:26 +00:00
|
|
|
<img src="static/delete.png" title="Löschen" alt="Delete" onclick="confirmDelete('{{ t }}')">
|
2021-03-07 22:19:44 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</body>
|
2021-03-07 23:05:26 +00:00
|
|
|
<script>
|
|
|
|
function confirmDelete(t) {
|
|
|
|
debugger
|
|
|
|
if (confirm('Token wirklich löschen?')) {
|
|
|
|
console.log('confirmed');
|
|
|
|
console.log(t);
|
|
|
|
$.post('{{ url_for('delete_token') }}', {token: t},
|
|
|
|
function (data) {
|
|
|
|
if (data === 'success') {
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2021-03-07 22:19:44 +00:00
|
|
|
</html>
|