add invite system
This commit is contained in:
36
app/templates/users/invite_links.html
Normal file
36
app/templates/users/invite_links.html
Normal file
@ -0,0 +1,36 @@
|
||||
{% from 'common/macros.html' import accordion %}
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}invites{% endblock %}
|
||||
{% block content %}
|
||||
<div class="darkbg inbox-container">
|
||||
<p>To manage growth, {{ config.SITE_NAME }} disallows direct sign ups. Instead, users already with an account may invite people they know. You can create invite links here. Once an invite link is used to sign up, it can no longer be used.</p>
|
||||
{% call(section) accordion(disabled=invites | length == 0) %}
|
||||
{% if section == 'header' %}
|
||||
Your invites
|
||||
{% else %}
|
||||
{% if invites %}
|
||||
<table class="colorful-table">
|
||||
<thead>
|
||||
<th class='small'>Link</th>
|
||||
<th class='small'>Revoke</th>
|
||||
</thead>
|
||||
{% for invite in invites %}
|
||||
<tr>
|
||||
<td><a href="{{url_for('users.sign_up', key=invite.key)}}">Link</a></td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('users.revoke_invite_link', username=active_user.username) }}">
|
||||
<input type=hidden value="{{ invite.key }}" name="key">
|
||||
<input type=submit class=warn value="Revoke">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
<form method="post" action="{{ url_for('users.create_invite_link', username=active_user.username) }}">
|
||||
<input type=submit value="Create new invite">
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user