Implement invite system

This commit is contained in:
Trever Fischer
2012-02-19 22:30:10 -05:00
parent 311c26e445
commit a1ca61b64a
11 changed files with 150 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
{% endif %}
</ul>
{% else %}
<p>Welcome! Do you have an invite?<p>
<p>Welcome! Do you have an invite? <a href="{% url profiles.views.claimInvite %}">Claim it!</a><p>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{%block title%}Claim an Invite{%endblock%}
{%block content %}
<form method="POST" action="{%url profiles.views.claimInvite%}">
{% csrf_token %}
{{form.as_p}}
<input type="submit" value="Claim!"/>
</form>
{%endblock%}

View File

@@ -0,0 +1,31 @@
{% extends 'base.html' %}
{% block title %}Invites{% endblock %}
{% block content %}
<p>Your Invites:</p>
<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>
{% endfor %}
{% else %}
<tr class="infoBar">
<td colspan="2">No invites!</td>
</tr>
{% endif %}
<tr class="actionBar">
<td colspan="2">
<a href="{% url profiles.views.createInvite %}">Create a new invite</a>
</td>
</tr>
</table>
{% endblock %}

View File

@@ -5,4 +5,5 @@
<p>Welcome, {{ user.username }}</p>
<a href="{%url profiles.views.edit %}">Edit profile</a>
<a href="{%url profiles.views.invites %}">Invites</a>
{%endblock%}

View File

@@ -0,0 +1,12 @@
{% extends "base.html" %}
{%block title%}Register an Account{%endblock%}
{%block content %}
<form method="POST" action="{%url profiles.views.register %}">
{% csrf_token %}
{{profileForm.as_p}}
{{userForm.as_p}}
<input type="submit" value="Register!"/>
</form>
{%endblock%}

View File

@@ -0,0 +1,14 @@
{% extends 'base.html' %}
{% block title %}Invite{% endblock %}
{% block content %}
<p>To invite a friend to Caminus, simply share them this code, or link to this page:</p>
<div id="invite-code">
<p>Code</p>
<input type="text" value="{{invite.code}}" onClick="this.select()"/>
<br />
<p>Link</p>
<input type="text" value="{{ invite.get_absolute_url }}" onClick="this.select()"/>
</div>
{% endblock %}