Implement invite system
This commit is contained in:
@@ -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>
|
||||
|
11
templates/profiles/claim_invite.html
Normal file
11
templates/profiles/claim_invite.html
Normal 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%}
|
||||
|
31
templates/profiles/invites.html
Normal file
31
templates/profiles/invites.html
Normal 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 %}
|
@@ -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%}
|
||||
|
12
templates/profiles/register.html
Normal file
12
templates/profiles/register.html
Normal 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%}
|
||||
|
14
templates/profiles/show_invite.html
Normal file
14
templates/profiles/show_invite.html
Normal 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 %}
|
Reference in New Issue
Block a user