{% extends "base.html" %} {% load static %} {% block title %}Subscription - {{ project_name }}{% endblock %} {% block content %} {% csrf_token %}

Subscription Management

Manage your monthly subscription plan

{% if not stripe_enabled or not stripe_available %}

Subscription Management Unavailable

{% if missing_api_keys %}

Stripe integration is not properly configured. Please contact support.

{% else %}

Subscription features are currently disabled.

{% endif %}
{% else %}

Current Subscription

{% if subscription and subscription.is_active %} Active {% else %} No Active Subscription {% endif %}
{% if subscription and subscription.is_active %}
{% with stripe_product=subscription.get_stripe_product %} {% if stripe_product %}

Plan: {{ stripe_product.name }}

Monthly Credits: {{ stripe_product.credit_amount }} credits

Price: ${{ stripe_product.price }}/month

{% else %}

Plan: Unknown Plan

{% endif %} {% endwith %} {% if subscription.current_period_start and subscription.current_period_end %}

Billing Period: {{ subscription.current_period_start|date:"M d, Y" }} - {{ subscription.current_period_end|date:"M d, Y" }}

{% endif %} {% if subscription.days_until_renewal is not None %} {% if subscription.days_until_renewal > 0 %}

Next Billing: {{ subscription.days_until_renewal }} days

{% elif subscription.days_until_renewal == 0 %}

Next Billing: Today

{% else %}

Status: Billing period expired

{% endif %} {% endif %} {% if subscription.cancel_at_period_end %}

Cancellation Scheduled: Your subscription will end on {{ subscription.current_period_end|date:"M d, Y" }}

{% endif %}
{% else %}

You don't have an active subscription. Subscribe to a monthly plan to get credits automatically each month.

  • Monthly credit allocation
  • Better value than pay-as-you-go
  • Automatic renewal
  • Cancel anytime
{% endif %}
{% if subscription_products %}

Available Plans

{% for product in subscription_products %}

{{ product.name }}

${{ product.price }}/month

{% if product.description %}

{{ product.description }}

{% endif %}
  • {{ product.credit_amount }} credits per month
  • Credits expire monthly
  • Cancel anytime
  • {% if product.credit_amount > 0 %}
  • {% widthratio product.price 1 product.credit_amount %} cents per credit
  • {% endif %}
{% if subscription and subscription.is_active and subscription.get_stripe_product.id == product.id %} Current Plan {% elif subscription and subscription.is_active %} {% with current_product=subscription.get_stripe_product %} {% if current_product and product.price > current_product.price %} Upgrade to {{ product.name }} {% elif current_product and product.price < current_product.price %} Downgrade to {{ product.name }} {% endif %} {% endwith %} {% else %} {% endif %}
{% endfor %}
{% endif %} {% if subscription_products|length > 1 %}

Plan Comparison

{% for product in subscription_products %} {% endfor %} {% for product in subscription_products %} {% endfor %} {% for product in subscription_products %} {% endfor %} {% for product in subscription_products %} {% endfor %} {% for product in subscription_products %} {% endfor %} {% for product in subscription_products %} {% endfor %} {% comment %} {% if subscription_products|length >= 2 %} {% with basic_plan=subscription_products.0 pro_plan=subscription_products.1 %} {% if pro_plan.credit_amount > basic_plan.credit_amount %} {% endif %} {% endwith %} {% endif %} {% endcomment %}
Feature {{ product.name }} {% if subscription and subscription.is_active and subscription.get_stripe_product.id == product.id %} Current {% endif %}
Monthly Price ${{ product.price }}/month
Monthly Credits {{ product.credit_amount }} credits
Cost per Credit {% if product.credit_amount > 0 %} {% widthratio product.price 1 product.credit_amount %} cents {% else %} N/A {% endif %}
Credits ExpireMonthly
CancellationAnytime
Savings vs Basic - {% widthratio basic_plan.price 1 basic_plan.credit_amount as basic_cost_per_credit %} {% widthratio pro_plan.price 1 pro_plan.credit_amount as pro_cost_per_credit %} {% if basic_cost_per_credit > pro_cost_per_credit %} Save {{ basic_cost_per_credit|sub:pro_cost_per_credit }} cents per credit {% endif %}
{% endif %}

Credit Balance

{% if user.credit_account %} {% with balance_breakdown=user.credit_account.get_balance_by_type %}

{{ balance_breakdown.subscription }}

Subscription Credits

{% if subscription and subscription.is_active %} Expires: {{ subscription.current_period_end|date:"M d, Y" }} {% else %} No active subscription {% endif %}

{{ balance_breakdown.pay_as_you_go }}

Pay-as-You-Go Credits

Never expire

{{ balance_breakdown.total }}

Total Credits

Available for use

{% endwith %} {% else %}

No credit account found.

{% endif %}
{% if subscription and subscription.is_active %}

Subscription Management

{% if subscription.cancel_at_period_end %}

Cancellation Scheduled

Your subscription will end on {{ subscription.current_period_end|date:"F d, Y" }}. You can reactivate it anytime before then.

{% else %}

You can cancel your subscription at any time. Your subscription will remain active until the end of your current billing period.

{% endif %}
{% endif %}
{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}