From f1d17c166a6128517894de100cbae9c3a6cda606 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Sun, 19 Feb 2023 20:50:27 -0500 Subject: [PATCH] Completed first-round of updates for the zone templates list view. --- powerdnsadmin/templates/template.html | 271 +++++++++++++------------- 1 file changed, 140 insertions(+), 131 deletions(-) diff --git a/powerdnsadmin/templates/template.html b/powerdnsadmin/templates/template.html index 165d828..3776d93 100644 --- a/powerdnsadmin/templates/template.html +++ b/powerdnsadmin/templates/template.html @@ -1,148 +1,157 @@ {% extends "base.html" %} - {% set active_page = "admin_domain_template" %} - -{% block title %} - - Templates - {{ SITE_NAME }} - -{% endblock %} +{% block title %}Zone Templates - {{ SITE_NAME }}{% endblock %} {% block dashboard_stat %} - -
-
-
-
-

- Templates - List -

-
-
- -
+
+
+
+
+

Zone Templates

+
+
+ +
+
+
-
-
- {% endblock %} {% block content %} -
-
- {% with errors = get_flashed_messages(category_filter=["error"]) %} - {% if errors %} -
-
-
- -

- Error! -

-
- x -
    - {%- for msg in errors %} -
  • {{ msg }}
  • - {% endfor -%} -
-
+
+
+ {% with errors = get_flashed_messages(category_filter=["error"]) %} + {% if errors %} +
+
+
+ +

+ Error! +

+
+ x +
    + {%- for msg in errors %} +
  • {{ msg }}
  • + {% endfor -%} +
+
+
+
+
+ {% endif %} + {% endwith %} + +
+
+
+
+

Templates

+ +
+ +
+ + + + + + + + + + + {% for template in templates %} + + + + + + + {% endfor %} + +
NameDescriptionTotal RecordsActions
+ + {{ template.name }} + + {{ template.description }}{{ template.records|count }} + +
+
+ +
+ +
+
-
+
- {% endif %} - {% endwith %} -
-
-
- -
- - - - - - - - - - - {% for template in templates %} - - - - - - - {% endfor %} - -
NameDescriptionNumber of RecordsActions
- - {{ template.name }} - - - {{ template.description }} - - {{ template.records|count }} - - -
-
-
-
-
-
-
+ + +{% endblock %} + +{% block head_styles %} + {% endblock %} {% block extrascripts %} - + // handle delete button + $(document.body).on("click", ".button_delete", function (e) { + var template = $(this).prop('id'); + $.post($SCRIPT_ROOT + '/admin/template/' + template + '/delete', { + '_csrf_token': '{{ csrf_token() }}' + }, function () { + window.location.href = '{{ url_for('admin.templates') }}'; + }); + }); + {% endblock %} {% block modals %}