{% extends "base.html" %}

{% block styles %}
{{ super() }}
{% endblock %}

{% block page_content %}
  <div class="row">
  {% include "admin/admin_tasks.html" %}

  <div class="col-md-12">
  <div class="panel panel-info" id="addresses">
  <div class="panel-heading">Addresses</div>
  <div class="panel-body"><p>
  {% include "admin/menu_deployments.html" %}
  <button class="btn btn-default" onclick="window.location.href='{{ url_for('admin.addr2pool') }}'"><span class="glyphicon glyphicon-plus" aria-hiddent="true"></span> Add IP to pool</button>

  <div class="no-more-tables">
  <table class="table table-hover table-striped table-condensed cf">
   <thead>
    <tr>
     <!--<th>Region</th>-->
     <th>IP</th>
     <th>Assignee</th>
     <th>Server</th>
     <th>VLAN</th>
     <th>Deploy</th>
     <th>rDNS</th>
    </tr>
    </thead>
    <tbody>
    {% for address in addresses %}
    <tr>
     {% if address.reserved == True %}<tr class="danger">{% else %}<tr>{% endif %}
     <!--<td data-title="Region">region1</td>-->
     <td data-title="IP">{{ address.ip }}</td>
     {% if address.user_id != None %}
     <td data-title="Assignee"><a href="{{ url_for('panel.dashboard', user_id=address.user_id) }}">{{ address.owner.email }}</a></td>
     {% else %}
     <td></td>
     {% endif %}
     {% if address.assignee != None %}
     <td data-title="Server">{{ address.assignee.deploy.server.name }}</td>
     <td data-title="VLAN">{{ address.assignee.vlan_id }}</td>
     <td data-title="Deploy">{{ address.assignee.deploy.machine_alias }}</td>
{% else %}
<td></td>
     <td></td>
     <td></td>
     {% endif %}

     {% if address.rdns != None %}
     <td data-title="rDNS">{{ address.rdns }}</td>
     {% else %}
     <td></td>
     {% endif %}
    {% endfor %}
    </tr>
    </tbody>
   </table>
  </div>
  </div>
  </div>


 </div>


  <div class="row">
  </div>
</div>

{% endblock %}

