{% extends "base.html" %}

{% block pagebanner %}
  <div class="header">
      <h2>Confirm Removal</h2>
  </div>
  <br/>
{% endblock %}

{% block sidebar %}
{% include "navbar.tmpl" %}
{% include "logout.tmpl" %}
{% endblock %}

{% block content %}

<form name="input" action="confirm.html?sub=true" method="post">
Are you sure you want to remove these items?

{% if interface %}
<ul>
<li> interface: {{ interface.mac_addr }} </li>
{% endif %}


{% if ips %}
<ul>
{% for ip in ips %}
<li> ip: {{ ip.ip_addr }} </li>
<ul>
{% for name in names %}
{% ifequal name.0 ip.id %}
<li> name: {{ name.1.name }} </li>
<ul>
{% endifequal %}
{% for cname in cnames %}
{% ifequal cname.0 name.1.id %}
<li> cname: {{ cname.1.name }} </li>
{% endifequal %}
{% endfor %}
</ul>
<ul>
{% for mx in mxs %}
{% ifequal mx.0 name.1.id %}
<li> mx: {{ mx.1.priority }} {{ mx.1.mx }} </li>
{% endifequal %}
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endif %}

{% if names and not ips %}
<ul>
{% for name in names %}
<li> name: {{ name.name }} </li>
<ul>
{% for cname in cnames %}
{% ifequal cname.0 name.id %}
<li> cname: {{ cname.1.cname }} </li>
{% endifequal %}
{% endfor %}
</ul>
<ul>
{% for mx in mxs %}
{% ifequal mx.0 name.id %}
<li> mx: {{ mx.1.priority }} {{ mx.1.mx }} </li>
{% endifequal %}
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endif %}

{% if cnames and not names %}
<ul>
{% for cname in cnames %}
<li> cname: {{ cname.cname }} </li>
{% endfor %}
</ul>
{% endif %}

{% if mxs and not names %}
<ul>
{% for mx in mxs %}
<li> mx: {{ mx.priority }} {{ mx.mx }} </li>
{% endfor %}
</ul>
{% endif %}

{% if interface %}
</ul>
{% endif %}

{% if zone_id %}
<ul>
{% ifequal type 'zonemx' %}
<li> mx: {{ zonemx.priority }} {{ zonemx.mx }} </li>
{% endifequal %}

{% ifequal type 'nameserver' %}
<li> nameserver: {{ nameserver.name }} </li>
{% endifequal %}

{% ifequal type 'address' %}
<li> address: {{ address.ip_addr }} </li>
{% endifequal %}
</ul>
{% endif %}

<input type="submit" value="confirm">
<input type="reset" value="cancel" onclick="history.back()">
</form>

{% endblock %}
