{% extends "authkeys/base.html" %}

{% block intro %}{{ _("API Keys: <b>Create Key</b>" | safe) }}{% endblock %}

{% block subcontent %}
    {% if not key %}
        {% trans %}
            <p>Describe your intended use for this key, below.
            <p><strong>NOTE:</strong> This will be your only means of identifying
            this key later, other than the date and time of its creation. So,
            be as clear as you can.</p>
        {% endtrans %}
        <form method="POST" action="" class="key">
            {{ csrf() }}
            {{ form.as_p() }}
            <button type="submit" name="action_create" class="button positive">{{ _("Create") }}</button>
            <a class="button" href="{{ url('authkeys.list') }}">{{ _('Cancel') }}</a>
        </form>
    {% else %}
        {% trans list_url=url('authkeys.list') %}
            <p>Your new key has been created. Please make a note of the details
            below (e.g. by copying them into your application's settings). This
            information will never be displayed again, and cannot be recovered if
            lost.</p>
            <p><strong>NOTE:</strong> 
            When you're done, <a class="button" href="{{ list_url }}">return to the key list</a>.
            Reloading this page will create a new key.</p>
        {% endtrans %}
        <dl class="key">
            <dt>{{ _("Key ID") }}</dt>
            <dd class="key"><code>{{ key.key }}</code></dd>
            <dt>{{ _("Secret") }}</dt>
            <dd class="secret"><code>{{ secret }}</code></dd>
            <dt>{{ _("Created") }}</dt>
            <dd>{{ key.created }}</dd>
            <dt>{{ _("Description") }}</dt>
            <dd class="description">{{ key.description }}</dd>
        </dl>
    {% endif %}
{% endblock %}
