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.

48 lines
2.2 KiB

6 years ago
6 years ago
  1. {% extends 'base.html' %}
  2. {% block header %}
  3. <h1>{% block title %}Admin{% endblock %}</h1>
  4. {% endblock %}
  5. {% block content %}
  6. <div id="activeRegistrationCodes">
  7. <table>
  8. <thead>
  9. <th>Registration Code</th>
  10. <th>Creation Time</th>
  11. <th>Expiration Time</th>
  12. <th>Usages</th>
  13. <th>Max Usages</th>
  14. <th>Expire</th>
  15. </thead>
  16. <tbody>
  17. {% for registration_code in registration_codes %}
  18. <tr>
  19. <td>{{ registration_code.code|tojson|safe }}</td>
  20. <td>{{ registration_code.creation_time|tojson|safe }}</td>
  21. <td>{{ registration_code.expiration_time|tojson|safe }}</td>
  22. <td>{{ registration_code.usages|tojson|safe }}</td>
  23. <td>{{ registration_code.max_usages|tojson|safe }}</td>
  24. <td>
  25. <form method="POST" action="/admin/expire_registration_code">
  26. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
  27. <input type="hidden" name="registration_code" value="{{ registration_code.code }}"/>
  28. {% if not registration_code.is_expired() %}
  29. <input type="submit" name="expire" value="Expire">
  30. {% else %}
  31. <input type="submit" name="delete" value="Delete">
  32. {% endif %}
  33. </form>
  34. </td>
  35. </tr>
  36. {% endfor %}
  37. </tbody>
  38. </table>
  39. </div>
  40. <hr>
  41. <form method="POST" action="/admin/add_registration_code">
  42. {{ add_registration_code_form.csrf_token }}
  43. {{ add_registration_code_form.expiration_time.label }} {{ add_registration_code_form.expiration_time() }}
  44. {{ add_registration_code_form.max_usages.label }} {{ add_registration_code_form.max_usages(default="1", value="1") }}
  45. <input type="submit" value="Add">
  46. </form>
  47. {% endblock %}