2021-01-29 23:38:42 +00:00
|
|
|
{% extends 'settings/admin_layout.html' %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% block header %}{% trans "Invites" %}{% endblock %}
|
2020-06-03 16:38:30 +00:00
|
|
|
{% load humanize %}
|
2021-01-29 23:38:42 +00:00
|
|
|
{% block panel %}
|
|
|
|
<section class="block">
|
2021-02-28 02:48:10 +00:00
|
|
|
<h2 class="title is-4">{% trans "Generate New Invite" %}</h2>
|
2020-09-30 04:45:59 +00:00
|
|
|
|
2021-01-29 23:38:42 +00:00
|
|
|
<form name="invite" action="{% url 'settings-invites' %}" method="post">
|
2020-09-30 04:45:59 +00:00
|
|
|
{% csrf_token %}
|
2020-11-06 23:08:40 +00:00
|
|
|
<div class="field is-grouped">
|
2020-09-30 04:45:59 +00:00
|
|
|
<div class="control">
|
2021-02-28 02:48:10 +00:00
|
|
|
<label class="label" for="id_expiry">{% trans "Expiry:" %}</label>
|
2020-11-06 23:08:40 +00:00
|
|
|
<div class="select">
|
|
|
|
{{ form.expiry }}
|
|
|
|
</div>
|
2020-09-30 04:45:59 +00:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
2021-02-28 02:48:10 +00:00
|
|
|
<label class="label" for="id_use_limit">{% trans "Use limit:" %}</label>
|
2020-11-06 23:08:40 +00:00
|
|
|
<div class="select">
|
|
|
|
{{ form.use_limit }}
|
|
|
|
</div>
|
2020-09-30 04:45:59 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-03 16:38:30 +00:00
|
|
|
|
2021-02-28 02:48:10 +00:00
|
|
|
<button class="button is-primary" type="submit">{% trans "Create Invite" %}</button>
|
2020-09-30 04:45:59 +00:00
|
|
|
</form>
|
2021-01-29 23:38:42 +00:00
|
|
|
</section>
|
2021-02-23 23:21:37 +00:00
|
|
|
|
|
|
|
<section class="block">
|
|
|
|
<table class="table is-striped">
|
|
|
|
<tr>
|
2021-02-28 02:48:10 +00:00
|
|
|
<th>{% trans "Link" %}</th>
|
|
|
|
<th>{% trans "Expires" %}</th>
|
|
|
|
<th>{% trans "Max uses" %}</th>
|
|
|
|
<th>{% trans "Times used" %}</th>
|
2021-02-23 23:21:37 +00:00
|
|
|
</tr>
|
|
|
|
{% if not invites %}
|
2021-02-28 02:48:10 +00:00
|
|
|
<tr><td colspan="4">{% trans "No active invites" %}</td></tr>
|
2021-02-23 23:21:37 +00:00
|
|
|
{% endif %}
|
|
|
|
{% for invite in invites %}
|
|
|
|
<tr>
|
|
|
|
<td><a href="{{ invite.link }}">{{ invite.link }}</td>
|
|
|
|
<td>{{ invite.expiry|naturaltime }}</td>
|
|
|
|
<td>{{ invite.use_limit }}</td>
|
|
|
|
<td>{{ invite.times_used }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% include 'snippets/pagination.html' with page=invites path=request.path %}
|
|
|
|
</section>
|
2020-06-03 16:38:30 +00:00
|
|
|
{% endblock %}
|