70 lines
2.3 KiB
HTML
70 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ _('My billing') }}{% endblock %}
|
|
{% block content %}
|
|
<div class="card billing-wrap">
|
|
<h2>{{ _('Billing') }}</h2>
|
|
|
|
<section class="billing-section">
|
|
<h3>{{ _('Current plan') }}</h3>
|
|
<div class="billing-plan">
|
|
<strong>{{ plan.name if plan else _('Free') }}</strong>
|
|
{% if sub and sub.is_active %}
|
|
<span class="badge ok">{{ sub.status }}</span>
|
|
{% if sub.current_period_end %}
|
|
<span class="muted small">
|
|
{{ _('Renews') if not sub.cancel_at_period_end else _('Ends') }}
|
|
{{ sub.current_period_end.strftime('%b %d, %Y') }}
|
|
</span>
|
|
{% endif %}
|
|
{% if sub.cancel_at_period_end %}
|
|
<span class="badge warn">{{ _('Canceling') }}</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="billing-actions">
|
|
{% if stripe_enabled %}
|
|
{% if sub and sub.stripe_customer_id %}
|
|
<a class="btn" href="{{ url_for('payments.portal') }}">{{ _('Manage subscription') }}</a>
|
|
{% else %}
|
|
<a class="btn" href="{{ url_for('payments.pricing') }}">{{ _('Upgrade plan') }}</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</section>
|
|
|
|
{% if active_boosts %}
|
|
<section class="billing-section">
|
|
<h3>{{ _('Active boosts') }}</h3>
|
|
<table class="list">
|
|
{% for b in active_boosts %}
|
|
<tr>
|
|
<td>{{ b.listing.title[:50] }}</td>
|
|
<td><span class="badge cat">{{ b.type }}</span></td>
|
|
<td class="muted small">{{ _('Expires') }} {{ b.expires_at.strftime('%b %d, %Y') }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="billing-section">
|
|
<h3>{{ _('Transaction history') }}</h3>
|
|
{% if not txns %}
|
|
<p class="muted">{{ _('No transactions yet.') }}</p>
|
|
{% else %}
|
|
<table class="list">
|
|
<tr><th>{{ _('Date') }}</th><th>{{ _('Type') }}</th><th>{{ _('Amount') }}</th><th>{{ _('Status') }}</th></tr>
|
|
{% for t in txns %}
|
|
<tr>
|
|
<td class="muted small">{{ t.created_at.strftime('%b %d, %Y') }}</td>
|
|
<td>{{ t.type }}</td>
|
|
<td>${{ "%.2f"|format(t.amount_cents / 100) }}</td>
|
|
<td><span class="badge {{ 'ok' if t.status == 'succeeded' else 'warn' }}">{{ t.status }}</span></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
{% endblock %}
|