{% extends "base.html" %} {% load crispy_forms_tags i18n icons permissions translations %} {% block breadcrumbs %} {% endblock breadcrumbs %} {% block content %} {% perm 'billing.manage' billing as user_can_manage_billing %}

{% icon "info.svg" %} {% translate "Billing plan" %} {% if billing.payment.recurring %} {% translate "Recurring payment" %} {% endif %} {% if not billing.is_active %} {% translate "Expired" %} {% elif not billing.paid %} {% translate "Past due date" %} {% elif not billing.in_limits %} {% translate "Exceeds limits" %} {% endif %}

{% include "billing/status.html" %} {% if billing.is_active %} {% endif %}

{% translate "Billing admins" %}

{% with owners=billing.owners.all %} {% for owner in owners %} {% endfor %} {% endwith %}
{{ owner }} @{{ owner.username }} {{ owner.email }} {% if owner.pk == user.pk %} {% translate "Revoke access" %} {% else %} {% translate "Revoke access" %} {% endif %}
{% if user_can_manage_billing %}

{% translate "Manage billing" %}

{% crispy merge_form %}
{% endif %}
{% with invoices=billing.invoice_set.order %} {% if invoices %}

{% translate "Invoices" %}

{% for invoice in billing.invoice_set.order %} {% empty %} {% endfor %}
{% translate "Invoice period" %} {% translate "Invoice amount" %} {% translate "Download invoice" %}
{{ invoice.start|date:"SHORT_DATE_FORMAT" }} - {{ invoice.end|date:"SHORT_DATE_FORMAT" }} {{ invoice.amount }} {{ invoice.get_currency_display }} {% if invoice.ref and invoice.filename_valid %} {{ invoice.filename }} {% elif invoice.ref %} {{ invoice.filename }} {% else %} {% translate "Not available" %} {% endif %}
{% translate "No invoices found." %}
{% endif %} {% endwith %} {% if user.is_superuser %}

{% translate "Audit log" %}

{% for log in billing.billinglog_set.recent %} {% endfor %}
{% translate "When" %} {% translate "Billing event" %} {% translate "Event details" %} {% translate "User" %}
{{ log.timestamp|naturaltime }} {{ log.get_event_display }} {{ log.summary }} {{ log.user }} {% if user.is_superuser and log.details.backup_filename %} {% translate "Download" %} {% endif %}
{% endif %} {% if offer_hosting and billing.plan.price == 0 %}

{% translate "Libre hosting" %} {% if billing.is_libre_trial and billing.payment.libre_request %} {% translate "Pending approval" %} {% endif %}

{% if billing.is_libre_trial and billing.valid_libre and not billing.payment.libre_request %} {# Second button for bigger visibility #} {% endif %} {% include "snippets/libre-checklist.html" %}
{% if billing.is_libre_trial %} {% endif %}
{% endif %}
{% endblock content %}