Commit a54b1fcf authored by Michal Čihař's avatar Michal Čihař

Display billing details if available

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f0e04654
......@@ -25,6 +25,9 @@
<li><a data-toggle="tab" href="#auth">{% trans "Authentication" %}</a></li>
<li><a data-toggle="tab" href="#profile">{% trans "Profile" %}</a></li>
<li><a data-toggle="tab" href="#licenses">{% trans "Licenses" %}</a></li>
{% if user.billing %}
<li><a data-toggle="tab" href="#billing">{% trans "Billing" %}</a></li>
{% endif %}
</ul>
<div class="tab-content">
......@@ -333,6 +336,66 @@
</div>
</div>
{% if user.billing %}
{% with user.billing as billing %}
<div class="tab-pane" id="billing">
<div class="row">
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Billing plan" %}</h4></div>
<div class="panel-body">
{% with billing.plan as plan %}
<table class="table">
<tr><th>{% trans "Current plan" %}</th><td>{{ plan.name }}</td></tr>
<tr><th>{% trans "Monthly price" %}</th><td>{{ plan.price }} EUR</td></tr>
<tr><th>{% trans "Yearly price" %}</th><td>{{ plan.yearly_price }} EUR</td></tr>
<tr><th>{% trans "Strings limit" %}</th><td>{% blocktrans with plan.display_limit_strings as total and billing.count_strings as used %}Used {{ used }} from {{ total }}{% endblocktrans %}</td></tr>
<tr><th>{% trans "Languages limit" %}</th><td>{% blocktrans with plan.display_limit_languages as total and billing.count_languages as used %}Used {{ used }} from {{ total }}{% endblocktrans %}</td></tr>
<tr><th>{% trans "Repositories limit" %}</th><td>{% blocktrans with plan.display_limit_repositories as total and billing.count_repositories as used %}Used {{ used }} from {{ total }}{% endblocktrans %}</td></tr>
<tr><th>{% trans "Projects limit" %}</th><td>{% blocktrans with plan.display_limit_projects as total and billing.projects.count as used %}Used {{ used }} from {{ total }}{% endblocktrans %}</td></tr>
</table>
{% endwith %}
</div>
</div>
</div>
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Invoices" %}</h4></div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Invoice period" %}</th>
<th>{% trans "Invoice amount" %}</th>
<th>{% trans "Download invoice" %}</th>
</tr>
</thead>
<tbody>
{% for invoice in billing.invoice_set.all %}
<tr>
<td>{{ invoice.start|date:"SHORT_DATE_FORMAT" }} - {{ invoice.end|date:"SHORT_DATE_FORMAT" }}</td>
<td>{{ invoice.payment }} {{ invoice.get_currency_display }}</td>
<td>{% trans "Not available" %}</td>
</tr>
{% empty %}
<tr><td colspan="3">{% trans "No invoices found!" %}</td/></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endwith %}
{% endif %}
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment