Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that happens when subscription is None #31

Merged
merged 1 commit into from
Apr 10, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions payments/templates/payments/_subscription_status.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{% with request.user.customer.current_subscription as subscription %}
{% if subscription.status == "active" %}
<div class="alert alert-info">
Your subscription will automatically renew in <strong>{{ subscription.current_period_end|timeuntil }}</strong>.
</div>
{% else %}
{% if subscription.status == "trialing" %}
{% if request.user.customer.plan and request.user.customer.card_kind %}
<div class="alert alert-info">
Your free trial will end in <strong>{{ subscription.current_period_end|timeuntil }}</strong> after which you commence a <strong>{{ subscription.plan_display }}</strong> plan.
</div>
{% else %}
<div class="alert alert-warning lead">
Your free trial will end in <strong>{{ subscription.current_period_end|timeuntil }}</strong> after which you will need to get a subscription to continue using the site.
</div>
{% endif %}
{% if subscription %}
{% if subscription.status == "active" %}
<div class="alert alert-info">
Your subscription will automatically renew in <strong>{{ subscription.current_period_end|timeuntil }}</strong>.
</div>
{% else %}
{% if subscription.status == "canceled" %}
{% if subscription.is_period_current %}
{% if subscription.status == "trialing" %}
{% if request.user.customer.plan and request.user.customer.card_kind %}
<div class="alert alert-info">
Your free trial will end in <strong>{{ subscription.current_period_end|timeuntil }}</strong> after which you commence a <strong>{{ subscription.plan_display }}</strong> plan.
</div>
{% else %}
<div class="alert alert-warning lead">
Your subscription has been <strong>canceled</strong> but you can continue to use the site for another <strong>{{ subscription.current_period_end|timeuntil }}</strong>.
Your free trial will end in <strong>{{ subscription.current_period_end|timeuntil }}</strong> after which you will need to get a subscription to continue using the site.
</div>
{% endif %}
{% else %}
{% if subscription.status == "canceled" %}
{% if subscription.is_period_current %}
<div class="alert alert-warning lead">
Your subscription has been <strong>canceled</strong> but you can continue to use the site for another <strong>{{ subscription.current_period_end|timeuntil }}</strong>.
</div>
{% else %}
<div class="alert alert-danger lead">
Your subscription has been <strong>canceled</strong>.
</div>
{% endif %}
{% else %}
<div class="alert alert-danger lead">
Your subscription has been <strong>canceled</strong>.
Your subscription is <strong>{{ subscription.status }}</strong>.
</div>
{% endif %}
{% else %}
<div class="alert alert-danger lead">
Your subscription is <strong>{{ subscription.status }}</strong>.
</div>
{% endif %}
{% endif %}
{% endif %}
Expand Down