Commits

George Notaras committed ecaa12c

Improved the template used to import zone files.

Comments (0)

Files changed (1)

src/powerdns_manager/templates/powerdns_manager/import_zone.html

-<html>
-    <head>
-        <title>Import zone file to PowerDNS Manager</title>
-        <style type="text/css" media="screen,projection">
+{% extends "admin/base_site.html" %}
+{% load i18n static %}
+{% load url from future %}
 
-            body {
-                font-family: sans;
-                font-size: 100%;
-            }
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
+
+{% block title %}{% trans "Import zone file to PowerDNS Manager" %}{% endblock %}
+
+{% block breadcrumbs %}
+    <div class="breadcrumbs">
+        <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
+        &rsaquo; {% trans 'Import zone file' %}
+    </div>
+{% endblock %}
+
+{% block content %}
+    <div id="content-main">
+        
+        <form action="" method="post">{% csrf_token %}
+        <div>
+            {% if form.errors %}
+                <p class="errornote">
+                {% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+                </p>
+            {% endif %}
+
+	        <h1>{% trans 'Import Zone File' %}</h1>
+	        <p>{% trans "This web form facilitates importing zone files to PowerDNS Manager by pasting the zone file data in the textarea below." %}</p>
+	        <p>{% trans "The origin field is optional. It should be filled in case this information is not available in your zone file either by the $ORIGIN directive or by using an FQDN in the name field of each record." %}</p>
+	        <p>{% trans "By checking ``overwrite``, if a zone with the same origin exists in your database will be deleted and replaced by the imported one. Proceed with caution." %}</p>
             
-            label {
-				width: 4em;
-				float: left;
-				text-align: right;
-				margin-right: 0.5em;
-				display: block
-			}
-				
-			.submit  {
-				margin-left: 4.5em;
-			}
-			 
-        </style>
+	        <fieldset class="module aligned wide">
+	
+	            <div class="form-row">
+	                {{ form.origin.errors }}
+	                <label for="id_origin" class="">{% trans 'Origin' %}:</label>{{ form.origin }}
+	            </div>
+	
+	            <div class="form-row">
+	                {{ form.zonetext.errors }}
+	                <label for="id_zonetext" class="required">{% trans 'Zone file text' %}:</label>{{ form.zonetext }}
+	            </div>
+	
+	            <div class="form-row">
+	                {{ form.overwrite.errors }}
+	                <label for="id_overwrite" class="">{% trans 'Overwrite?' %}:</label>{{ form.overwrite }}
+	            </div>
+	
+	        </fieldset>
 
-  </head>
-  <body>
-    <h1>Import Zone File</h2>
-	<form action="{% url import_zone %}" method="post">{% csrf_token %}
-	   {{ form.as_p }}
-	   <input class="submit" type="submit" value="Submit" />
-	</form>
+	        <div class="submit-row">
+	            <input type="submit" value="{% trans 'Import zone' %}" class="default" />
+	        </div>
 
-  </body>
-</html>
+            <script type="text/javascript">document.getElementById("id_origin").focus();</script>
+        </div>
+        </form>
+
+    </div> <!-- content-main -->
+{% endblock %}