{% if prefix or gateways_obj %}
<div class="card">
    <h5 class="card-header">
        Routing
    </h5>
    <div class="card-body">
        <table class="table table-hover attr-table">
            {% if prefix %}
            <!-- <tr><td>prefix_id</td><td>{{ prefix.id }}</td></tr> -->
            <tr><td>Prefix</td><td>{{ prefix }}  <a href="{% url 'ipam:prefix' pk=prefix.pk %}"><i class="mdi mdi-link-variant"></i></a></td></tr>
            {% endif %}
            {% if gateways_obj %}
            <!-- <tr><td>gateway_id</td><td>{{ gateways_obj.id }}</td></tr> -->
            <tr><td>Gateway IP</td><td>{{ gateways_obj.gateway_ip.address.ip }} <a href="{% url 'ipam:ipaddress' pk=gateways_obj.gateway_ip.pk %}"><i class="mdi mdi-link-variant"></i></a></td></tr>
            <tr><td>Netmask</td><td>{{ gateways_obj.gateway_ip.address.netmask }}</td></tr>
            <tr><td>Wildcard</td><td>{{ wildcard_bits }}</td></tr>
            {% if gateways_obj.gateway_ip.assigned_object %}
            <tr><td>Gateway Device</td>
                <td>
                {% if gateways_obj.gateway_ip.assigned_object.parent_object %}
                {{ gateways_obj.gateway_ip.assigned_object.parent_object|linkify }} / 
                {% endif %}
                {{ gateways_obj.gateway_ip.assigned_object|linkify }}
                </td>
            </tr>
            {% endif %}
            {% endif %}
        </table>
    </div>
</div>
{% endif %}
