Implement invite deleting/revoking

This commit is contained in:
Trever Fischer
2012-02-19 23:12:57 -05:00
parent 55201d6a22
commit 35fae8b679
6 changed files with 52 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% block title %}Delete Invite{% endblock %}
{% block content %}
<form method="POST" action="{%url profiles.views.deleteInvite code=invite.code %}">
{% csrf_token %}
<p>If you delete this invite, it may not be used to create an account. If you already gave this invite to someone, <em>they will not be able to use it!</em></p>
<p>Are you sure you want to delete this invite?</p>
<input type="submit" value="Yes, I'm sure."/>
</form>
{% endblock %}

View File

@@ -4,16 +4,32 @@
{% block content %}
<p>Your Invites:</p>
<table>
<table id='invite-table'>
<tr class="header">
<th>Code</th>
<th>Invited User</th>
</tr>
{% if invites %}
{% for invite in invites %}
<tr>
<td><a href="{{invite.get_absolute_url}}">{{invite.code}}</a></td>
<td>{{invite.claimer}}</td>
<tr class="{%cycle 'even' 'odd' %} {% if invite.deleted %}deleted{%endif%}">
<td>
{% if invite.deleted %}
{{invite.code}}
{% else %}
<a href="{{invite.get_absolute_url}}">{{invite.code}}</a>
{% endif %}
</td>
<td>
{% if invite.claimer %}
{{invite.claimer}}
{% else %}
{% if invite.deleted %}
<em>Deleted</em>
{% else %}
<a href="{%url profiles.views.deleteInvite code=invite.code %}">Delete</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
{% else %}