{% extends 'generic/object_edit.html' %}
{% load i18n %}
{% block content %}
{% if not request.user.is_superuser %}
{% include 'inc/alerts/warning.html' with title="Creating API Tokens" message="Non-superusers should generally create and modify API tokens under their user profile." %}
{% endif %}
{% include 'users/inc/v1_token_warning.html' %}
{{ block.super }}
{% endblock %}
{% block javascript %}
{{ block.super }}
{% endblock javascript %}
{% block buttons %}
{# Omit the "Create & Add Another" button: that flow would redirect away from the detail page before the #}
{# one-time plaintext can be displayed, leaving the new token unrecoverable. #}
{% trans "Cancel" %}
{% if object.pk %}
{% else %}
{% endif %}
{% endblock buttons %}