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.

67 lines
2.8 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>Registration Link</th>
  15. <th>Expire</th>
  16. </thead>
  17. <tbody>
  18. {% for registration_code in registration_codes %}
  19. <tr>
  20. <td>{{ registration_code.code|tojson|safe }}</td>
  21. <td>{{ registration_code.creation_time|tojson|safe }}</td>
  22. <td>{{ registration_code.expiration_time|tojson|safe }}</td>
  23. <td>{{ registration_code.usages|tojson|safe }}</td>
  24. <td>{{ registration_code.max_usages|tojson|safe }}</td>
  25. <td><a href="/register?registrationCode={{ registration_code.code }}">link</a>
  26. <td>
  27. <form method="POST" action="/admin/expire_registration_code">
  28. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
  29. <input type="hidden" name="registration_code" value="{{ registration_code.code }}"/>
  30. {% if not registration_code.is_expired() %}
  31. <input type="submit" name="expire" value="Expire">
  32. {% else %}
  33. <input type="submit" name="delete" value="Delete">
  34. {% endif %}
  35. </form>
  36. </td>
  37. </tr>
  38. {% endfor %}
  39. </tbody>
  40. </table>
  41. </div>
  42. <hr>
  43. <div id="registeredUsers">
  44. <table>
  45. <thead>
  46. <th>User</th>
  47. <th>Registration Time</th>
  48. </thead>
  49. <tbody>
  50. {% for registered_user in registered_users %}
  51. <tr>
  52. <td>{{ registered_user.username|tojson|safe }}</td>
  53. <td>{{ registered_user.registration_time|tojson|safe }}</td>
  54. </tr>
  55. {% endfor %}
  56. </tbody>
  57. </table>
  58. </div>
  59. <hr>
  60. <form method="POST" action="/admin/add_registration_code">
  61. {{ add_registration_code_form.csrf_token }}
  62. {{ add_registration_code_form.expiration_time.label }} {{ add_registration_code_form.expiration_time() }}
  63. {{ add_registration_code_form.max_usages.label }} {{ add_registration_code_form.max_usages(default="1", value="1") }}
  64. <input type="submit" value="Add">
  65. </form>
  66. {% endblock %}