You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
2.2 KiB
49 lines
2.2 KiB
{% extends 'base.html' %}
|
|
|
|
{% block header %}
|
|
<h1>{% block title %}Admin{% endblock %}</h1>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div id="activeRegistrationCodes">
|
|
<table>
|
|
<thead>
|
|
<th>Registration Code</th>
|
|
<th>Creation Time</th>
|
|
<th>Expiration Time</th>
|
|
<th>Usages</th>
|
|
<th>Max Usages</th>
|
|
<th>Expire</th>
|
|
</thead>
|
|
<tbody>
|
|
{% for registration_code in registration_codes %}
|
|
<tr>
|
|
<td>{{ registration_code.code|tojson|safe }}</td>
|
|
<td>{{ registration_code.creation_time|tojson|safe }}</td>
|
|
<td>{{ registration_code.expiration_time|tojson|safe }}</td>
|
|
<td>{{ registration_code.usages|tojson|safe }}</td>
|
|
<td>{{ registration_code.max_usages|tojson|safe }}</td>
|
|
<td>
|
|
<form method="POST" action="/admin/expire_registration_code">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
<input type="hidden" name="registration_code" value="{{ registration_code.code }}"/>
|
|
{% if not registration_code.is_expired() %}
|
|
<input type="submit" name="expire" value="Expire">
|
|
{% else %}
|
|
<input type="submit" name="delete" value="Delete">
|
|
{% endif %}
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<hr>
|
|
<form method="POST" action="/admin/add_registration_code">
|
|
{{ add_registration_code_form.csrf_token }}
|
|
{{ add_registration_code_form.expiration_time.label }} {{ add_registration_code_form.expiration_time() }}
|
|
{{ add_registration_code_form.max_usages.label }} {{ add_registration_code_form.max_usages(default="1", value="1") }}
|
|
<input type="submit" value="Add">
|
|
</form>
|
|
{% endblock %}
|