|
@@ -5,9 +5,27 @@
|
|
|
{% if not request.user.is_superuser %}
|
|
{% 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." %}
|
|
{% 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 %}
|
|
{% endif %}
|
|
|
|
|
+ {% include 'users/inc/v1_token_warning.html' %}
|
|
|
{{ block.super }}
|
|
{{ block.super }}
|
|
|
{% endblock %}
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
+{% block javascript %}
|
|
|
|
|
+{{ block.super }}
|
|
|
|
|
+<script>
|
|
|
|
|
+ (function () {
|
|
|
|
|
+ const versionField = document.getElementById('id_version');
|
|
|
|
|
+ const v1Warning = document.getElementById('v1-deprecation-warning');
|
|
|
|
|
+ if (versionField && v1Warning) {
|
|
|
|
|
+ function updateV1Warning() {
|
|
|
|
|
+ v1Warning.style.display = versionField.value === '1' ? '' : 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+ versionField.addEventListener('change', updateV1Warning);
|
|
|
|
|
+ updateV1Warning();
|
|
|
|
|
+ }
|
|
|
|
|
+ })();
|
|
|
|
|
+</script>
|
|
|
|
|
+{% endblock javascript %}
|
|
|
|
|
+
|
|
|
{% block buttons %}
|
|
{% block buttons %}
|
|
|
{# Omit the "Create & Add Another" button: that flow would redirect away from the detail page before the #}
|
|
{# 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. #}
|
|
{# one-time plaintext can be displayed, leaving the new token unrecoverable. #}
|