{% extends "base.html" %}

{% block pagebanner %}
  <div class="header">
      <h2>Zones</h2>
      <p>Edit information for {{ zone }}
  </div>
  <br/>
{% endblock %}

{% block sidebar %}
{% include "navbar.tmpl" %}
<ul>
<li><a href="/hostbase/zones/{{ zone_id }}/" class="sidebar">view zone</a><br>
</li>
</ul>
{% include "logout.tmpl" %}
{% endblock %}

{% block content %}

<script language="JavaScript" type="text/Javascript">
function toggleField(fieldname){
   if(document.getElementById){
      var style = document.getElementById(fieldname).style;
      style.display = style.display? "":"block";
   }
}
</script>

<style type=text/css>
div#nameserver{
   display: none;
}
div#mx{
   display: none;
}
div#address{
   display: none;
}
</style>

<form name="zonedata" action="" method="post">
   <fieldset class="module aligned ()">
<label for="id_zone">zone:</label></td> <td>{{ form.zone }}<br>
<label for="id_admin">admin:</label></td> <td>{{ form.admin }}<br>
<label for="id_primary_master">primary_master:</label></td> <td>{{ form.primary_master }}<br>
<label for="id_expire">expire:</label></td> <td>{{ form.expire }}<br>
<label for="id_retry">retry:</label></td> <td>{{ form.retry }}<br>
<label for="id_refresh">refresh:</label></td> <td>{{ form.refresh }}<br>
<label for="id_ttl">ttl:</label></td> <td>{{ form.ttl }}<br>
{% for ns in nsforms %}
<label for="id_name">nameserver:</label></td> <td>{{ ns.name }}<br>
{% endfor %}
</table>
<div id=nameserver>
   <label for="id_name">nameserver:</label></td> <td>{{ nsadd.name }}<br>
   <label for="id_name">nameserver:</label></td> <td>{{ nsadd.name }}<br>
</div>
<a style="font-size:75%" href=# onclick="toggleField('nameserver')">Add NS records</a><br>
{% for mx in mxforms %}
<label for="id_mx">mx:</label></td> <td>{{ mx.priority }} {{ mx.mx }}<br>
{% endfor %}
<div id=mx>
   <label for="id_mx">mx:</label></td> <td>{{ mxadd.priority }} {{ mxadd.mx }}<br>
   <label for="id_mx">mx:</label></td> <td>{{ mxadd.priority }} {{ mxadd.mx }}<br>
</div>
<a style="font-size:75%" href=# onclick="toggleField('mx')">Add MX records</a><br>
{% for a in aforms %}
<label for="id_address">ip address:</label></td> <td>{{ a.ip_addr }}<br>
{% endfor %}
<div id=address>
   <label for="id_address">ip address:</label></td> <td>{{ addadd.ip_addr }}<br>
   <label for="id_address">ip address:</label></td> <td>{{ addadd.ip_addr }}<br>
</div>
<a style="font-size:75%" href=# onclick="toggleField('address')">Add A records</a><br>
<label for="id_aux">aux:</label></td> <td>{{ form.aux }}<br>
<p><input type="submit" value="Submit">
</form>

{% endblock %}
