{% extends "phoxtail_core/modal_drawer.html" %} {% comment %} A token (level 0), titled by its name: its details and, while it is active and the viewer may, Revoke. A revoke closes the drawer, and the list redraws itself. {% endcomment %} {% load i18n phoxtail_design_tags %} {% block title %}{{ token.name }}{% endblock %} {% block body %}

{% icon "vpn_key" %} {% translate "Token" %}

{% if token.description %}

{{ token.description }}

{% endif %}
{% icon "key" %} {{ token.token_fingerprint }}
{% if can_manage_all %}
{% icon "person" %} {{ token.user.get_full_name|default:token.user.email }}
{% endif %}

{% icon "lock" %} {% translate "Access" %}

{% icon "tune" %} {% if token.unrestricted %} {% translate "Unrestricted: anything its owner can do" %} {% else %} {{ token.scopes|join:", " }} {% endif %}
{% icon "calendar_lock" %} {% if token.expires_at %} {% blocktranslate with expires_at=token.expires_at|date:"M j, Y H:i" %}Expires {{ expires_at }}{% endblocktranslate %} {% else %} {% translate "Never expires" %} {% endif %}

{% icon "schedule" %} {% translate "Activity" %}

{% icon "calendar_month" %} {% blocktranslate with created_at=token.created_at|date:"M j, Y H:i" %}Created {{ created_at }}{% endblocktranslate %}
{% icon "schedule" %} {% if token.last_used_at %} {% blocktranslate with last_used_at=token.last_used_at|date:"M j, Y H:i" %}Last used {{ last_used_at }}{% endblocktranslate %} {% else %} {% translate "Never used" %} {% endif %}
{% if token.revoked_at %}
{% icon "cancel" %} {% blocktranslate with revoked_at=token.revoked_at|date:"M j, Y H:i" %}Revoked {{ revoked_at }}{% endblocktranslate %}
{% endif %}
{% if can_revoke and token.is_active %}

{% icon "danger" %} {% translate "Revoke token" %}

{% translate "Any client or script using this token stops working at once. This cannot be undone." %}

{% endif %}
{% endblock %}