From 5a4279d7b8426cafa443ce2d17cea6b750b68e06 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Mon, 20 Feb 2023 09:56:26 -0500 Subject: [PATCH] Completed first-found updates for the API key add/edit view. --- powerdnsadmin/templates/admin_edit_key.html | 581 +++++++++++--------- 1 file changed, 308 insertions(+), 273 deletions(-) diff --git a/powerdnsadmin/templates/admin_edit_key.html b/powerdnsadmin/templates/admin_edit_key.html index 23f58d3..c7eeec9 100644 --- a/powerdnsadmin/templates/admin_edit_key.html +++ b/powerdnsadmin/templates/admin_edit_key.html @@ -1,303 +1,338 @@ {% extends "base.html" %} - {% set active_page = "admin_keys" %} - -{% if (key is not none and key.role.name != "User") %}{% set hide_opts = True %}{%else %}{% set hide_opts = False %}{% endif %} - -{% block title %} - - Edit Key - {{ SITE_NAME }} - -{% endblock %} +{% if create %} + {% set action_label = 'Create' %} + {% set form_action = url_for('admin.edit_key') %} +{% else %} + {% set action_label = 'Edit' %} + {% set form_action = url_for('admin.edit_key', key_id=key.id) %} +{% endif %} +{% if (key is not none and key.role.name != "User") %}{% set hide_opts = True %}{% else %} + {% set hide_opts = False %}{% endif %} +{% block title %}{{ action_label }} API Key - {{ SITE_NAME }}{% endblock %} {% block dashboard_stat %} -
-
-
-
-

- API Keys - {% if create %}Add API Key{% else %}Edit API Key - {{ key.id }}{% endif %} -

+
+
+
+
+

{{ action_label }} API Key

+
+
+ +
+
-
- -
-
-
{% endblock %} {% block content %} -
-
-
-
-
-
-

{% if create %}Add{% else %}Edit{% endif %} Key

-
-
- - -
-
- - -
-
- - - -
-
- - - -
+ + {% endblock %} {% block extrascripts %} - + function redirect_modal() { + window.location.href = '{{ url_for('admin.manage_keys') }}'; + modal.modal('hide'); + } + {% endif %} + {% endblock %} + {% block modals %} -