1. George Notaras
  2. django-powerdns-manager

Commits

George Notaras  committed b47e2c1

Added button in the Domain changelist view to add zone from zone file.

  • Participants
  • Parent commits 4966d07
  • Branches default

Comments (0)

Files changed (2)

File src/powerdns_manager/admin.py

View file
     verbose_name_plural = 'zones'
     save_on_top = True
     actions = [set_domain_type_bulk, set_ttl_bulk]
+    change_list_template = 'powerdns_manager/domain_changelist.html'
     
     #
     # Build the ``inlines`` list. Only inlines for enabled RR types are included.

File src/powerdns_manager/templates/powerdns_manager/domain_changelist.html

View file
+{% extends "admin/change_list.html" %}
+{% load i18n %}
+{% load url from future %}
+
+{% block object-tools-items %}
+    {% if not is_popup %}
+        <li><a href="{% url 'import_zone' %}">{% trans 'Import from zone file' %}</a></li>
+    {% endif %}
+    {{block.super}}
+{% endblock %}