{% load i18n %}

<div class="panel panel-primary">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Billing plan" %}</h4></div>

  {% with billing.plan as plan %}
  <table class="table">
  <tr><th>{% trans "Current plan" %}</th><td>{{ plan.name }} ({{ billing.get_state_display }})</td><td><a href="https://weblate.org/hosting/" class="btn btn-default btn-xs pull-right flip">{% trans "See other plans" %}</a></td></tr>
  <tr><th>{% trans "Monthly price" %}</th><td>{{ plan.price }} EUR</td><td></td></tr>
  <tr><th>{% trans "Yearly price" %}</th><td>{{ plan.yearly_price }} EUR</td><td></td></tr>
  <tr><th>{% trans "Strings limit" %}</th>
  {% with plan.limit_strings as max and plan.display_limit_strings as total and billing.count_strings as used %}
  {% include "billing/used.html" %}
  {% endwith %}
  </tr>
  <tr><th>{% trans "Languages limit" %}</th>
  {% with plan.limit_languages as max and plan.display_limit_languages as total and billing.count_languages as used %}
  {% include "billing/used.html" %}
  {% endwith %}
  </tr>
  <tr><th>{% trans "Repositories limit" %}</th>
  {% with plan.limit_repositories as max and plan.display_limit_repositories as total and billing.count_repositories as used %}
  {% include "billing/used.html" %}
  {% endwith %}
  </tr>
  <tr><th>{% trans "Projects limit" %}</th>
  {% with plan.limit_projects as max and plan.display_limit_projects as total and billing.projects.count as used %}
  {% include "billing/used.html" %}
  {% endwith %}
  </tr>
  <tr><th>{% trans "Projects" %}</th>
  <td colspan="2"><div class="list-group">
  {% for project in billing.projects.all %}
  <a class="list-group-item" href="{{ project.get_absolute_url }}">{{ project }}</a>
  {% endfor %}
  </div></td>
  </tr>
  </table>
  {% endwith %}
</div>

