Usage

{% extends "site_base.html" %}

{% block messages %}{% endblock %}

{% block body %}
<section class="fragment-container">
    <h1>Pinax Invitations Fragments</h1>

    <h2><div class="variation">Can Send</div><code>_invite_form.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invite_form.html" with user=can_send_user %}
    </div>

    <h2><div class="variation">Cannot Send</div><code>_invite_form.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invite_form.html" %}
    </div>

    <h2><div class="variation">With Invitations</div><code>_invited.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invited.html" with invited_list=invites %}
    </div>

    <h2><div class="variation">No Invitations</div><code>_invited.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invited.html" %}
    </div>

    <h2><div class="variation">Remaining Invites</div><code>_invites_remaining.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invites_remaining.html" with invites_remaining=total_invites_remaining %}
    </div>

    <h2><div class="variation">No Remaining Invites</div><code>_invites_remaining.html</code></h2>
    <div class="invitation-fragement-container">
        {% include "pinax/invitations/_invites_remaining.html" %}
    </div>
</section>
{% endblock %}

pinax/invitations/_invite_form.html

{% load i18n %}
{% load bootstrap %}

<div class="pinax-invitations-invites-form">
    {% if user.invitationstat.can_send %}
        <form action="{% url "pinax_invitations:invite" %}"
              class="ajax"
              data-replace-closest=".pinax-invitations-invites-form"
              method="POST"
              accept-charset="utf-8">
            {% csrf_token %}
            {{ form|bootstrap }}
            <div class="form-actions">
                <button>
                    {% trans "Invite" %}
                </button>
            </div>
        </form>
    {% else %}
        <p>
            {% trans "You do not have any invitations currrently." %}
        </p>
    {% endif %}
</div>

pinax/invitations/_invited.html

{% load i18n %}
{% load pinax_invitations_tags %}

<ul class="pinax-invitations-invites-sent">
    {% for invited in invited_list %}
        <li class="{{ invited|status_class }}">
            {% if invited.to_user %}
                <a href="{{ invited.to_user.get_profile.get_absolute_url }}">
                    {{ invited.signup_code.email }}
                </a>
            {% else %}
                {{ invited.signup_code.email }}
            {% endif %}
        </li>
    {% empty %}
        <li class="empty-invites">
            {% trans "You have not sent any invitations yet." %}
        </li>
    {% endfor %}
</ul>

pinax/invitations/_invites_remaining.html

<div class="pinax-invitations-invites-remaining {% if invites_remaining %}has-remaining{% else %}no-remaining{% endif %}">
    {{ invites_remaining|default:"0" }}
</div>