{% extends "payments/base.html" %}
{% load url from future %}

{% block title %}Purchase a Subscription{% endblock title %}

{% block body %}
    {% with request.user.customer.current_subscription as subscription %}
        {% if not subscription or subscription.status != 'active'  %}
            {% include "payments/_subscription_status.html" %}
            {% include "payments/_subscribe_form.html" %}
        {% else %}
            <h2>Purchase a Subscription</h2>
            <p class="lead">You currently already have an active subscription, which will automatically renew in <strong>{{ subscription.current_period_end|timeuntil }}</strong>. If you like, you can view your <a href="{% url 'payments_history' %}">payment history</a>, <a href="{% url 'payments_change_card' %}">change your card</a> or <a href="{% url 'payments_change_plan' %}">change your subscription</a>.</p>
        {% endif %}
    {% endwith %}
{% endblock %}