{% load i18n %}
{% load translations %}

  {% with billing.plan as plan %}
  <table class="table">
  <tr><th>{% trans "Current plan" %}</th><td>{{ plan.name }} ({{ billing.get_state_display }}{% if billing.expiry %}{% blocktrans with expires=billing.expiry|naturaltime %}, expires {{ expires }}{% endblocktrans %}{% endif %})</td><td><a href="https://weblate.org/hosting/" class="btn btn-primary 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 "Last invoice" %}</th>
  <td colspan="2">{{ billing.last_invoice }}</td></tr>
  <tr><th>{% trans "Projects limit" %}</th>
  {% with plan.limit_projects as max and plan.display_limit_projects as total and projects|length as used %}
  {% include "billing/used.html" %}
  {% endwith %}
  </tr>
  <tr><th>{% trans "Projects" %}</th>
  <td colspan="2"><div class="list-group">
  {% for project in projects %}
  <a class="list-group-item" href="{{ project.get_absolute_url }}">{{ project }}</a>
  {% empty %}
  {% trans "No projects currently assigned!" as msg %}
  {% show_message "warning" msg %}
{% if billing.is_active %}
  <a class="btn btn-primary billing-add-project" href="{% url 'create-project' %}?billing={{ billing.pk }}">{% trans "Add new translation project" %}</a>
{% endif %}
  {% endfor %}
  </div></td>
  </tr>
  </table>
  {% endwith %}
