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

add trans block when needed for pinax stripe app #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

{% load i18n %}

<table class="table table-bordered">
<thead>
<tr>
<th>Date</th><th>Description</th><th>Period</th><th>Total</th><th>Paid</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Period" %}</th>
<th>{% trans "Total" %}</th>
<th>{% trans "Paid" %}</th>
</tr>
</thead>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

Expand All @@ -8,7 +9,7 @@
{% block body %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Payment History</h4>
<h4 class="panel-title">{% trans "Payment History" %}</h4>
</div>
{% include "pinax/stripe/_invoice_table.html" with invoices=object_list %}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

{% block body_class %}pinax-stripe-payment-methods{% endblock %}

{% block body %}

<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Create Payment Method</h4>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">{% trans "Create Payment Method" %}</h4>
</div>
<div class="panel-body">
{% if errors %}
<div class="alert alert-danger">
{{ errors }}
</div>
<div class="panel-body">
{% if errors %}
<div class="alert alert-danger">
{{ errors }}
{% endif %}
<form class="form-horizontal" data-stripe-key="{{ PINAX_STRIPE_PUBLIC_KEY }}" action="{% url "pinax_stripe_payment_method_create" %}" method="post">
{% csrf_token %}
<div class="card">
<div class="errors"></div>
<div class="form-group">
<label for="number" class="col-sm-2 control-label">{% trans "Card Number" %}</label>
<div class="col-sm-7">
<input type="text" class="form-control" size="20" data-stripe="number" />
</div>
</div>
<div class="form-group">
<label for="expMonth" class="col-sm-2 col-xs-3 control-label">{% trans "Expiration" %}</label>
<div class="col-sm-1 col-xs-2">
<input type="text" size="2" class="form-control" id="payment-exp-month" data-stripe="exp-month" placeholder="MM"/>
</div>
{% endif %}
<form class="form-horizontal with-card" data-stripe-key="{{ PINAX_STRIPE_PUBLIC_KEY }}" action="{% url "pinax_stripe_payment_method_create" %}" method="post">
{% csrf_token %}
<div class="card-wrapper"></div>
<div class="card">
<input type="text" placeholder="Card Number" class="card-number form-control" size="20" data-stripe="number" />
<input type="text" placeholder="Name on Card" class="card-name form-control" size="20" name="name" />
<input type="text" size="2" class="card-exp-month form-control" data-stripe="exp-month" placeholder="MM"/>
<input type="text" size="4" class="card-exp-year form-control" data-stripe="exp-year" placeholder="YYYY"/>
<input type="text" size="4" class="card-cvc form-control" data-stripe="cvc" placeholder="CVC" />
<button class="btn btn-primary">Add</button>
<div class="col-sm-2 col-xs-3">
<input type="text" size="4" class="form-control" id="payment-exp-year" data-stripe="exp-year" placeholder="YYYY"/>
</div>
</form>
<label for="cvc" class="col-xs-2 control-label for-cvc">{% trans "CVC" %}</label>
<div class="col-sm-2 col-xs-2">
<input type="text" size="4" class="form-control" id="payment-exp-cvc" data-stripe="cvc" placeholder="000" />
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-primary">{% trans "Add" %}</button>
</div>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

Expand All @@ -13,7 +14,7 @@
{{ object.last4 }}
Expires {{ object.exp_month }} / {{ object.exp_year }}
</div>
<h4 class="panel-title">Delete Payment Method</h4>
<h4 class="panel-title">{% trans "Delete Payment Method" %}</h4>
</div>
<div class="panel-body">
{% if errors %}
Expand All @@ -23,8 +24,8 @@ <h4 class="panel-title">Delete Payment Method</h4>
{% endif %}
<form action="{% url "pinax_stripe_payment_method_delete" object.pk %}" method="post">
{% csrf_token %}
<button class="btn btn-danger">Delete</button>
</form>
<button class="btn btn-danger">{% trans "Delete" %}</button>
</button>
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% block body_class %}pinax-stripe-payment-methods{% endblock %}

Expand All @@ -8,20 +9,26 @@
<div class="panel-heading">
<a class="pull-right btn btn-xs btn-primary" href="{% url "pinax_stripe_payment_method_create" %}">
<i class="fa fa-plus"></i>
Add Payment Method
{% trans "Add Payment Method" %}
</a>
<h4 class="panel-title">Payment Methods</h4>
<h4 class="panel-title">{% trans "Payment Methods" %}</h4>
</div>
<table class="table table-bordered">
<thead>
<tr><th></th><th>Kind</th><th>Last 4</th><th class="text-right">Expiration</th><th class="text-right">Created</th></tr>
<tr>
<th></th>
<th>{% trans "Kind" %}</th>
<th>{% trans "Last 4" %}</th>
<th class="text-right">{% trans "Expiration" %}</th>
<th class="text-right">{% trans "Created" %}</th>
</tr>
</thead>
<tbody>
{% for source in object_list %}
<tr>
<td>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_payment_method_delete" source.pk %}">Delete</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_payment_method_update" source.pk %}">Update</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_payment_method_delete" source.pk %}">{% trans "Delete" %}</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_payment_method_update" source.pk %}">{% trans "Update" %}</a>
</td>
<td>{{ source.brand }}</td>
<td>{{ source.last4 }}</td>
Expand All @@ -30,7 +37,7 @@ <h4 class="panel-title">Payment Methods</h4>
</tr>
{% empty %}
<tr>
<td colspan="5">You have no payment methods</td>
<td colspan="5">{% trans "You have no payment methods" %}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

Expand All @@ -13,7 +14,7 @@
{{ object.last4 }}
Expires {{ object.exp_month }} / {{ object.exp_year }}
</div>
<h4 class="panel-title">Update Payment Method</h4>
<h4 class="panel-title">{% trans "Update Payment Method" %}</h4>
</div>
<div class="panel-body">
{% if errors %}
Expand All @@ -26,7 +27,7 @@ <h4 class="panel-title">Update Payment Method</h4>
<div class="card">
<div class="errors"></div>
<div class="form-group">
<label for="expMonth" class="col-sm-2 control-label">Expiration</label>
<label for="expMonth" class="col-sm-2 control-label">{% trans "Expiration" %}</label>
<div class="col-sm-1">
<input type="text" size="2" class="form-control" name="expMonth" />
</div>
Expand All @@ -37,7 +38,7 @@ <h4 class="panel-title">Update Payment Method</h4>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-primary">Update</button>
<button class="btn btn-primary">{% trans "Update" %}</button>
</div>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

Expand All @@ -9,7 +10,7 @@
<div class="panel panel-default">
<div class="panel-heading">
<span class="pull-right">{{ object.plan.name }}</span>
<h4 class="panel-title">Cancel Subscription</h4>
<h4 class="panel-title">{% trans "Cancel Subscription" %}</h4>
</div>
{% if errors %}
<div class="panel-body">
Expand All @@ -22,11 +23,11 @@ <h4 class="panel-title">Cancel Subscription</h4>
<div class="panel-body">
<form class="form" action="{% url "pinax_stripe_subscription_delete" object.pk %}" method="post">
{% csrf_token %}
<button class="btn btn-danger">Cancel</button>
<button class="btn btn-danger">{% trans "Cancel" %}</button>
</form>
</div>
<div class="panel-footer">
You began your subscription of <strong>{{ object.plan.name }}</strong> on
{% trans "You began your subscription of" %} <strong>{{ object.plan.name }}</strong> {% trans "on" %}
{{ object.start }}.
</div>
</div>
Expand Down
56 changes: 25 additions & 31 deletions pinax_theme_bootstrap/templates/pinax/stripe/subscription_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% load bootstrap %}

Expand All @@ -13,38 +14,31 @@
{% url "pinax_stripe_subscription_create" as post_url %}
{% endif %}

<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<span class="pull-right">{% if object %}{{ object.plan.name }}{% endif %}</span>
<h4 class="panel-title">{% if object %}Change{% else %}Add{% endif %} Subscription</h4>
</div>
<div class="panel-body">
{% if errors %}
<div class="alert alert-danger">
{{ errors }}
</div>
{% endif %}
<form class="form {% if not request.user.customer.default_source %}with-card{% endif %}" {% if not request.user.customer.default_source %}data-stripe-key="{{ PINAX_STRIPE_PUBLIC_KEY }}"{% endif %} action="{{ post_url }}" method="post">
{% csrf_token %}
<div style="width: 350px; margin: 10px auto;">
{{ form|bootstrap }}
</div>
{% if not request.user.customer.default_source %}
<div class="card-wrapper"></div>
<div class="card">
<input type="text" placeholder="Card Number" class="card-number form-control" size="20" data-stripe="number" />
<input type="text" placeholder="Name on Card" class="card-name form-control" size="20" name="name" />
<input type="text" size="2" class="card-exp-month form-control" data-stripe="exp-month" placeholder="MM"/>
<input type="text" size="4" class="card-exp-year form-control" data-stripe="exp-year" placeholder="YYYY"/>
<input type="text" size="4" class="card-cvc form-control" data-stripe="cvc" placeholder="CVC" />
</div>
{% endif %}
<button class="btn btn-primary pull-right" style="margin-top: 5px; margin-right: 10px;">{% if object %}Update{% else %}Subscribe{% endif %}</button>
</form>
<div class="panel panel-default">
<div class="panel-heading">
<span class="pull-right">{% if object %}{{ object.plan.name }}{% endif %}</span>
<h4 class="panel-title">{% if object %}{% trans "Change" %}{% else %}{% trans "Add"}{% endif %} {% trans "Subscription" %}</h4>
</div>
<div class="panel-body">
{% if errors %}
<div class="alert alert-danger">
{{ errors }}
</div>
</div>
{% endif %}
<form class="form" {% if not request.user.customer.default_source %}data-stripe-key="{{ PINAX_STRIPE_PUBLIC_KEY }}"{% endif %} action="{{ post_url }}" method="post">
{% csrf_token %}
{{ form|bootstrap }}
{% if not request.user.customer.default_source %}
<div class="card">
<div class="errors"></div>
<input type="text" size="20" data-stripe="number" placeholder="Card number"/>
<input type="text" size="2" data-stripe="exp-month"/>
<input type="text" size="4" data-stripe="exp-year"/>
<input type="text" size="4" data-stripe="cvc" placeholder="CVC"/>
</div>
{% endif %}
<button class="btn btn-primary">{% if object %}{% trans "Update" %}{% else %}{% trans "Subscribe" %}{% endif %}</button>
</form>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
{% extends "pinax/stripe/base.html" %}

{% load i18n %}

{% block body_class %}pinax-stripe-subscriptions{% endblock %}

{% block body %}
<div class="panel panel-default">
<div class="panel-heading">
<a class="pull-right btn btn-xs btn-primary" href="{% url "pinax_stripe_subscription_create" %}">
<i class="fa fa-plus"></i>
Add Subscription
{% trans "Add Subscription" %}
</a>
<h4 class="panel-title">Current Subscriptions</h4>
<h4 class="panel-title">{% trans "Current Subscriptions" %}</h4>
</div>
<table class="table table-bordered">
<thead>
<tr><th></th><th>Current Period</th><th>Plan</th><th>Since</th><th>Status</th></tr>
<tr>
<th></th>
<th>{% trans "Current Period" %}</th>
<th>{% trans "Plan" %}</th>
<th>{% trans "Since" %}</th>
<th>{% trans "Status" %}</th>
</tr>
</thead>
<tbody>
{% for subscription in object_list %}
<tr>
<td>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_subscription_delete" subscription.pk %}">Cancel</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_subscription_update" subscription.pk %}">Update</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_subscription_delete" subscription.pk %}">{% trans "Cancel" %}</a>
<a class="btn btn-xs btn-default" href="{% url "pinax_stripe_subscription_update" subscription.pk %}">{% trans "Update" %}</a>
</td>
<td>
{{ subscription.current_period_start.date }}—{{subscription.current_period_end.date }}
Expand All @@ -36,7 +44,9 @@ <h4 class="panel-title">Current Subscriptions</h4>
</td>
</tr>
{% empty %}
<tr><td colspan="5">You have no subscriptions.</td></tr>
<tr>
<td colspan="4">{% trans "You have no subscriptions" %}.</td>
</tr>
{% endfor %}
</tbody>
</table>
Expand Down