Changeset View
Changeset View
Standalone View
Standalone View
subscriptions/templates/subscriptions/components/manage.html
| Show All 28 Lines | <div class="row"> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| </ul> {% endcomment %} | </ul> {% endcomment %} | ||||
| <ul class="list-group list-group-flush list-group-account"> | <ul class="list-group list-group-flush list-group-account"> | ||||
| {% if not user.subscription_set.count %} | {% if not user.subscription_set.count %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col"> | <div class="col"> | ||||
| <a class="btn btn-primary btn-lg mt-3" href="{% url 'subscriptions:join' %}">Subscribe</a> | <a class="btn btn-primary btn-lg mt-3" href="{% url 'subscriptions:join' %}">Subscribe</a> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| {% else %} | {% else %} | ||||
| {# Blender Cloud only allows one subscriptin per account #} | {# Blender Cloud only allows one subscriptin per account #} | ||||
| {% with subscription=user.subscription_set.first %} | {% with subscription=user.subscription_set.first %} | ||||
| {% with order=subscription.latest_order %} | {% with order=subscription.latest_order %} | ||||
| {% if subscription.status == 'on-hold' %} | {% if subscription.status == 'on-hold' %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col"> | <div class="col"> | ||||
| <p class="h4 mb-0 text-danger">Subscription On Hold</p> | <p class="h4 mb-0 text-danger">Subscription On Hold</p> | ||||
| <p class="x-small subtitle">Your subscription hasn't been paid for and is currently <strong>on-hold</strong>. | <p class="x-small subtitle">Your subscription hasn't been paid for and is currently <strong>on-hold</strong>. | ||||
| </p> | </p> | ||||
| </div> | </div> | ||||
| <div class="col-auto"> | <div class="col-auto"> | ||||
| <a class="btn btn-sm btn-danger" href="{% url 'subscriptions:pay-existing-order' order_id=order.pk %}">Pay | <a class="btn btn-sm btn-danger" href="{% url 'subscriptions:pay-existing-order' order_id=order.pk %}">Pay | ||||
| subscription</a> | subscription</a> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| {% endif %} | {% endif %} | ||||
| {% if subscription.status %} | {% if subscription.status %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <div class=row> | <div class=row> | ||||
| <div class="col"> | <div class="col"> | ||||
| <p class="h4 mb-0">Billing Period</p> | <p class="h4 mb-0">Billing Period</p> | ||||
| {% if subscription.next_payment %} | {% if subscription.next_payment %} | ||||
| {% if subscription.status == 'active' or subscription.status == 'on-hold' %} | {% if subscription.status == 'active' or subscription.status == 'on-hold' %} | ||||
| {% if subscription.next_payment_in_future %} | {% if subscription.next_payment_in_future %} | ||||
| <p class="x-small subtitle">Your subscription will renew | <p class="x-small subtitle">Your subscription will renew | ||||
| {{ subscription.collection_method }}{% if subscription.collection_method == 'automatic' %}ally{% else %}ly{% endif %} | {{ subscription.collection_method }}{% if subscription.collection_method == 'automatic' %}ally{% else %}ly{% endif %} | ||||
| on | on | ||||
| {{ subscription.next_payment|date }} for {{ subscription | pricing }}.</p> | {{ subscription.next_payment|date }} for {{ subscription | pricing }}.</p> | ||||
| {% else %} | {% else %} | ||||
| <p class="x-small subtitle">Your last {{ subscription.collection_method }} payment is due on | <p class="x-small subtitle">Your last {{ subscription.collection_method }} payment is due on | ||||
| {{ subscription.next_payment|date }} for {{ subscription | pricing }}.</p> | {{ subscription.next_payment|date }} for {{ subscription | pricing }}.</p> | ||||
| {% endif %} | {% endif %} | ||||
| {% elif subscription.status == 'pending-cancellation' %} | {% elif subscription.status == 'pending-cancellation' %} | ||||
| <p class="x-small subtitle">Your subscription is pending cancellation. It will be deactivated on | <p class="x-small subtitle">Your subscription is pending cancellation. It will be deactivated on | ||||
| {{ subscription.next_payment|date }}.</p> | {{ subscription.next_payment|date }}.</p> | ||||
| {% endif %} | {% endif %} | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| <div class="col-auto"> | <div class="col-auto"> | ||||
| <p class="mb-0 small">{{ subscription | pricing }}</p> | <p class="mb-0 small">{{ subscription | pricing }}</p> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| {% endif %} | {% endif %} | ||||
| {% if subscription.collection_method != 'managed' %} | {% if subscription.collection_method != 'managed' %} | ||||
| {% with subscription.payment_method as pay_meth %} | {% with subscription.payment_method as pay_meth %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <div class=row> | <div class=row> | ||||
| <div class="col"> | <div class="col"> | ||||
| <p class="h4 mb-0">Payment method</p> | <p class="h4 mb-0">Payment method</p> | ||||
| </div> | </div> | ||||
| <div class="col-auto small"> | <div class="col-auto small"> | ||||
| {% if not pay_meth %} | {% if not pay_meth %} | ||||
| Unknown | Unknown | ||||
| {% elif pay_meth.is_deleted %} | {% elif pay_meth.is_deleted %} | ||||
| The payment method previously used for this subscription was removed. | The payment method previously used for this subscription was removed. | ||||
| {% else %} | {% else %} | ||||
| {{ pay_meth.recognisable_name }} | {{ pay_meth.recognisable_name }} | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| <div class="col-auto"> | <div class="col-auto"> | ||||
| <a class=" small" | <a class=" small" | ||||
| href="{% url 'subscriptions:payment-method-change' subscription_id=subscription.id %}">Change</a> | href="{% url 'subscriptions:payment-method-change' subscription_id=subscription.id %}">Change</a> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| {% endwith %} | {% endwith %} | ||||
| {% endif %} | {% endif %} | ||||
| {% comment %} {% if subscription and subscription.collection_method == 'automatic' and 'cancel' not in subscription.status %} | {% comment %} {% if subscription and subscription.collection_method == 'automatic' and 'cancel' not in subscription.status %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <h3>Automatic Payment</h3> | <h3>Automatic Payment</h3> | ||||
| {% if order %} | {% if order %} | ||||
| {% if order.status == 'created' %} | {% if order.status == 'created' %} | ||||
| {% elif order.status == 'soft-failed' %} | {% elif order.status == 'soft-failed' %} | ||||
| <p> | <p> | ||||
| Automatic payment failed on {{ transaction.recorded_at }}, but we will automatically try again soon. | Automatic payment failed on {{ transaction.recorded_at }}, but we will automatically try again soon. | ||||
| We have made {{ order.collection_attempts }} of a maximum of {{ settings.LOOPER_CLOCK_MAX_AUTO_ATTEMPTS }} | We have made {{ order.collection_attempts }} of a maximum of {{ settings.LOOPER_CLOCK_MAX_AUTO_ATTEMPTS }} | ||||
| Show All 30 Lines | <p> | ||||
| Please contact <a | Please contact <a | ||||
| href="mailto:{{ ADMIN_MAIL }}?subject=No next payment for subscription {{ subscription.id }}">{{ ADMIN_MAIL }}</a> | href="mailto:{{ ADMIN_MAIL }}?subject=No next payment for subscription {{ subscription.id }}">{{ ADMIN_MAIL }}</a> | ||||
| about this. | about this. | ||||
| </p> | </p> | ||||
| {% endif %} | {% endif %} | ||||
| </li> | </li> | ||||
| {% endif %} {% endcomment %} | {% endif %} {% endcomment %} | ||||
| {% comment %} FIXME(anna): implement Extend your subscription or remove this block | {% comment %} FIXME(anna): implement Extend your subscription or remove this block | ||||
| {% if may_be_charged %} | {% if may_be_charged %} | ||||
| <hr /> | <hr /> | ||||
| <div class="row"> | <div class="row"> | ||||
| <h3>Extend your Subscription</h3> | <h3>Extend your Subscription</h3> | ||||
| <p>You can arbitrarily extend your subscription by paying any amount. <a | <p>You can arbitrarily extend your subscription by paying any amount. <a | ||||
| href="{% url 'subscriptions:extend' subscription_id=subscription.id %}">Extend my subscription now!</a></p> | href="{% url 'subscriptions:extend' subscription_id=subscription.id %}">Extend my subscription now!</a></p> | ||||
| </div> | </div> | ||||
| {% endif %}{% endcomment %} | {% endif %}{% endcomment %} | ||||
| <li class="list-group-item"> | <li class="list-group-item"> | ||||
| <div class="row"> | <div class="row"> | ||||
| {% if subscription and subscription.status == 'cancelled' %} | {% if subscription and subscription.status == 'cancelled' %} | ||||
| <div class="col"> | <div class="col"> | ||||
| <p class="h4 mb-0">Subscription Cancelled</p> | <p class="h4 mb-0">Subscription Cancelled</p> | ||||
| <p class="x-small subtitle">This subscription has been cancelled. :(</p> | <p class="x-small subtitle">This subscription has been cancelled. :(</p> | ||||
| </div> | </div> | ||||
| {% else %} | {% else %} | ||||
| <div class="col"> | <div class="col"> | ||||
| <p class="h4 mb-0">Cancel Subscription</p> | <p class="h4 mb-0">Cancel Subscription</p> | ||||
| <p class="x-small subtitle">You will still have the remainder of the billing period to access content.</p> | <p class="x-small subtitle">You will still have the remainder of the billing period to access content.</p> | ||||
| </div> | </div> | ||||
| <div class="col-auto"> | <div class="col-auto"> | ||||
| <form id="payment-form" method="post" enctype="multipart/form-data" | <form id="payment-form" method="post" enctype="multipart/form-data" | ||||
| action="{% url 'subscriptions:cancel' subscription.id %}"> | action="{% url 'subscriptions:cancel' subscription.id %}"> | ||||
| {% csrf_token %} | {% csrf_token %} | ||||
| <div class="d-flex justify-content-center"> | <div class="d-flex justify-content-center"> | ||||
| {% if subscription.status != 'pending-cancellation' and subscription.status != 'cancelled' %} | {% if subscription.status != 'pending-cancellation' and subscription.status != 'cancelled' %} | ||||
| <a class="ml-auto small text-danger" href="{% url 'subscriptions:cancel' subscription.id %}"><span>Cancel | <a class="ml-auto small text-danger" href="{% url 'subscriptions:cancel' subscription.id %}"><span>Cancel | ||||
| subscription</span></a> | subscription</span></a> | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| </form> | </form> | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| </li> | </li> | ||||
| {% endwith %} | {% endwith %} | ||||
| {% endwith %} | {% endwith %} | ||||
| {% endif %} | {% endif %} | ||||
| </ul> | </ul> | ||||