forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account view and more user friendly action views
- Loading branch information
Showing
9 changed files
with
150 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% extends "payments/base.html" %} | ||
|
||
{% block title %}Account{% endblock title %} | ||
|
||
{% block content %} | ||
{{ block.super }} | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<h2>Account Information</h2> | ||
{% include "djstripe/includes/_subscription_status.html" %} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-6"> | ||
<p> | ||
Credit Card on file. | ||
<a class="btn btn-info" href="">Show card</a> | ||
</p> | ||
</div> | ||
<div class="col-6"> | ||
<p class="pull-right"> | ||
Next billed on {{ subscription.current_period_end }} | ||
<a class="btn btn-primary" href="{% url 'djstripe:subscribe' %}">Update credit card</a> | ||
</p> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Plan</th> | ||
<th>Interval</th> | ||
<th>Description</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
{% for plan in plans %} | ||
<tr> | ||
<td>{{ plan.name }}</td> | ||
<td>{{ plan.interval.title }}ly</td> | ||
<td>{{ plan.description }}</td> | ||
<td>Your plan</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock content %} | ||
|
||
{% block javascript %} | ||
{{ block.super }} | ||
<script> | ||
$(function() { | ||
$.post("{% url 'djstripe:sync_history' %}", function(data) { | ||
$('#history-table').html(data); | ||
}); | ||
}); | ||
</script> | ||
{% endblock javascript %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,21 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
|
||
{% block content %} | ||
{% with customer.current_subscription as subscription %} | ||
{% if subscription %} | ||
{% if subscription.status == "active" %} | ||
<div class="alert alert-info"> | ||
Your subscription will automatically renew in <strong>{{ subscription.current_period_end|timeuntil }}</strong>. | ||
<!-- Modal --> | ||
<div class="modal fade" id="in-progress"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Server Update In-Progress <img src="{% static 'img/in-progress.gif' %}" /></h4> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="progress"> | ||
<div class="progress-bar" style="width: 0%;"></div> | ||
</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 %} | ||
{% 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 is <strong>{{ subscription.status }}</strong>. | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
{% endwith %} | ||
</div> | ||
|
||
</div><!-- /.modal-content --> | ||
</div><!-- /.modal-dialog --> | ||
</div><!-- /.modal --> | ||
{% endblock %} |
31 changes: 31 additions & 0 deletions
31
djstripe/templates/djstripe/includes/_subscription_status.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% if subscription %} | ||
{% if subscription.status != "active" %} | ||
{% 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 %} | ||
{% 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 is <strong>{{ subscription.status }}</strong>. | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters