{% load crispy_forms_tags %} {% load i18n %}
{% translate "API Tokens" %}

{% translate "Use these tokens for automations such as n8n. The raw token is shown only once after creation." %}

{% if raw_token %}
{% translate "Copy this token now" %}

{% translate "It will not be shown again after this response." %}

{% endif %}
{% crispy api_token_form %}
{% if api_tokens %}
{% for token in api_tokens %} {% endfor %}
{{ token.name }} {% if token.revoked_at %} {% translate "Revoked" %} {% else %} {% translate "Active" %} {% endif %}
{{ token.token_key }}
{% blocktranslate with created=token.created_at|date:"Y-m-d" %}Created {{ created }}{% endblocktranslate %} · {% if token.last_used_at %} {% blocktranslate with used=token.last_used_at|date:"Y-m-d H:i" %}last used {{ used }}{% endblocktranslate %} {% else %} {% translate "never used" %} {% endif %} · {% if token.expires_at %} {% blocktranslate with expires=token.expires_at|date:"Y-m-d" %}expires {{ expires }}{% endblocktranslate %} {% else %} {% translate "no expiry" %} {% endif %}
{% if not token.revoked_at %} {% endif %}
{% else %}
{% endif %}