2021-09-08 21:05:08 +00:00
|
|
|
{% extends 'settings/layout.html' %}
|
2021-03-21 02:39:08 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% load humanize %}
|
|
|
|
{% block header %}{% trans "Invite Requests" %}{% endblock %}
|
|
|
|
{% block panel %}
|
|
|
|
|
|
|
|
<div class="tabs">
|
|
|
|
<ul>
|
|
|
|
{% url 'settings-invite-requests' as url %}
|
|
|
|
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
|
|
|
|
<a href="{{ url }}">{% trans "Invite Requests" %}</a>
|
|
|
|
</li>
|
2021-03-21 15:17:48 +00:00
|
|
|
{% url 'settings-invites' as url %}
|
|
|
|
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
|
|
|
|
<a href="{{ url }}">{% trans "Invites" %}</a>
|
|
|
|
</li>
|
2021-03-21 02:39:08 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<section class="block">
|
2021-03-21 15:17:48 +00:00
|
|
|
<h2 class="title is-4">
|
|
|
|
{% if ignored %}
|
|
|
|
{% trans "Ignored Invite Requests" %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "Invite Requests" %}
|
2021-03-28 18:15:26 +00:00
|
|
|
{% endif %} ({{ count }})
|
2021-03-21 15:17:48 +00:00
|
|
|
</h2>
|
2021-03-21 02:39:08 +00:00
|
|
|
|
2021-04-01 21:14:17 +00:00
|
|
|
{% include 'settings/invite_request_filters.html' %}
|
|
|
|
|
2021-04-04 17:36:28 +00:00
|
|
|
<table class="table is-striped is-fullwidth">
|
2021-04-01 20:41:08 +00:00
|
|
|
{% url 'settings-invite-requests' as url %}
|
2021-03-21 02:39:08 +00:00
|
|
|
<tr>
|
2021-04-01 20:41:08 +00:00
|
|
|
<th>
|
2021-04-04 17:36:28 +00:00
|
|
|
{% trans "Date requested" as text %}
|
2021-04-01 20:41:08 +00:00
|
|
|
{% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
|
|
|
|
</th>
|
2021-04-04 17:36:28 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Date accepted" as text %}
|
|
|
|
{% include 'snippets/table-sort-header.html' with field="invite__invitees__created_date" sort=sort text=text %}
|
|
|
|
</th>
|
2021-03-21 02:39:08 +00:00
|
|
|
<th>{% trans "Email" %}</th>
|
2021-04-01 20:41:08 +00:00
|
|
|
<th>
|
|
|
|
{% trans "Status" as text %}
|
|
|
|
{% include 'snippets/table-sort-header.html' with field="invite__times_used" sort=sort text=text %}
|
|
|
|
</th>
|
2021-03-21 03:15:50 +00:00
|
|
|
<th>{% trans "Action" %}</th>
|
2021-03-21 02:39:08 +00:00
|
|
|
</tr>
|
|
|
|
{% if not requests %}
|
|
|
|
<tr><td colspan="4">{% trans "No requests" %}</td></tr>
|
|
|
|
{% endif %}
|
|
|
|
{% for req in requests %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ req.created_date | naturaltime }}</td>
|
2021-04-04 17:36:28 +00:00
|
|
|
<td>{{ req.invite.invitees.first.created_date | naturaltime }}</td>
|
2021-03-21 02:39:08 +00:00
|
|
|
<td>{{ req.email }}</td>
|
2021-03-21 03:15:50 +00:00
|
|
|
<td>
|
|
|
|
{% if req.invite.times_used %}
|
|
|
|
{% trans "Accepted" %}
|
|
|
|
{% elif req.invite %}
|
|
|
|
{% trans "Sent" %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "Requested" %}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2021-04-04 17:38:40 +00:00
|
|
|
<td><div class="field is-grouped">
|
2021-04-02 01:00:39 +00:00
|
|
|
{# no invite OR invite not yet used #}
|
|
|
|
{% if not req.invite.times_used %}
|
2021-04-01 20:55:10 +00:00
|
|
|
<form name="send-invite" method="post">
|
2021-03-21 16:13:21 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="invite-request" value="{{ req.id }}">
|
|
|
|
{% if not req.invite %}
|
|
|
|
<button type="submit" class="button is-link is-light is-small">{% trans "Send invite" %}</button>
|
|
|
|
{% else %}
|
|
|
|
<button type="submit" class="button is-link is-light is-small">{% trans "Re-send invite" %}</button>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
2021-04-02 01:00:39 +00:00
|
|
|
{% endif %}
|
2021-03-21 16:13:21 +00:00
|
|
|
|
2021-04-02 01:00:39 +00:00
|
|
|
{# invite created but not used #}
|
2021-03-21 03:15:50 +00:00
|
|
|
{% if req.invite and not req.invite.times_used %}
|
2021-03-21 16:13:21 +00:00
|
|
|
{# <button class="button is-danger is-light is-small">{% trans "Revoke invite" %}</button> #}
|
2021-04-02 01:00:39 +00:00
|
|
|
{% elif req.invite %}
|
|
|
|
{# accepted #}
|
|
|
|
{% if req.invite.invitees.exists %}
|
|
|
|
<a href="{{ req.invite.invitees.first.local_path }}">@{{ req.invite.invitees.first.localname }}</a>
|
2021-04-02 02:45:38 +00:00
|
|
|
{% else %}
|
|
|
|
|
2021-04-02 01:00:39 +00:00
|
|
|
{% endif %}
|
2021-03-21 03:15:50 +00:00
|
|
|
{% else %}
|
2021-03-21 16:13:21 +00:00
|
|
|
<form name="ignore-request" method="post" action="{% url 'settings-invite-requests-ignore' %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="invite-request" value="{{ req.id }}">
|
|
|
|
{% if not req.ignored %}
|
|
|
|
<button type="submit" class="button is-danger is-light is-small">{% trans "Ignore" %}</button>
|
|
|
|
{% else %}
|
2021-04-02 01:00:39 +00:00
|
|
|
<button type="submit" class="button is-danger is-light is-small">{% trans "Un-ignore" %}</button>
|
2021-03-21 16:13:21 +00:00
|
|
|
{% endif %}
|
|
|
|
</form>
|
2021-03-21 03:15:50 +00:00
|
|
|
{% endif %}
|
2021-04-04 17:38:40 +00:00
|
|
|
</div></td>
|
2021-03-21 02:39:08 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% include 'snippets/pagination.html' with page=requests path=request.path %}
|
2021-03-21 15:17:48 +00:00
|
|
|
|
|
|
|
{% if ignored %}
|
|
|
|
<p><a href="{% url 'settings-invite-requests' %}">{% trans "Back to pending requests" %}</a></p>
|
|
|
|
{% else %}
|
|
|
|
<p><a href="{% url 'settings-invite-requests' %}?ignored=True">{% trans "View ignored requests" %}</a></p>
|
|
|
|
{% endif %}
|
2021-03-21 02:39:08 +00:00
|
|
|
</section>
|
|
|
|
{% endblock %}
|