A simple web application that allows invitation based registration to a matrix instance
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.
 
 
 
 
 

71 lines
3.0 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>Registration Link</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>
{% if not registration_code.is_expired() %}
<a href="/register?registrationCode={{ registration_code.code }}">link</a>
{% endif %}
<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>
<div id="registeredUsers">
<table>
<thead>
<th>User</th>
<th>Registration Time</th>
</thead>
<tbody>
{% for registered_user in registered_users %}
<tr>
<td>{{ registered_user.username|tojson|safe }}</td>
<td>{{ registered_user.registration_time|tojson|safe }}</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 %}