{% load i18n sizeformat %}

<div class="detail">
  <dl class="dl-horizontal">
    <dt title="{% trans 'Name' %}">{% trans "Name" %}</dt>
    <dd>{{ subnet.name|default:_("None") }}</dd>
    <dt title="{% trans 'ID' %}">{% trans "ID" %}</dt>
    <dd data-display="{{ subnet.id|default:_("None") }}">{{subnet.id|default:_("None") }}</dd>
    <dt title="{% trans 'Network Name' %}">{% trans "Network Name" %}</dt>
    <dd>{{ subnet.network_name|default:_("None") }}</dd>
    <dt title="{% trans 'Network ID' %}">{% trans "Network ID" %}</dt>
    <dd><a href="{{ subnet.network_url }}">{{ subnet.network_id|default:_("None") }}</a></dd>
    <dt title="{% trans 'Subnetpool' %}">{% trans "Subnetpool" %}</dt>
    {% if subnet.subnetpool_id %}
      <dd>{{ subnet.subnetpool_name }} ({{ subnet.subnetpool_id }})</dd>
    {% else %}
      <dd>{% trans "None" %}</dd>
    {% endif %}
    <dt title="{% trans 'IP version' %}">{% trans "IP version" %}</dt>
    <dd>{{ subnet.ipver_str|default:_("-") }}</dd>
    <dt title="{% trans 'CIDR' %}">{% trans "CIDR" %}</dt>
    <dd>{{ subnet.cidr|default:_("None") }}</dd>
    <dt title="{% trans 'IP allocation pool' %}">{% trans "IP allocation pool" %}</dt>
    <dd>
      {% for pool in subnet.allocation_pools %}
        {% trans "Start" %}  {{ pool.start }}
        {% trans " - End" %} {{ pool.end   }}<br>
      {% endfor %}
    </dd>
    <dt title="{% trans 'Gateway IP' %}">{% trans "Gateway IP" %}</dt>
    <dd>{{ subnet.gateway_ip|default:_("-") }}</dd>
    <dt title="{% trans 'DHCP Enable' %}">{% trans "DHCP Enable" %}<dt>
    <dd>{{ subnet.enable_dhcp|yesno|capfirst }}</dd>
    {% if subnet.ip_version == 6 %}
      <dt title="{% trans 'IPv6 Address Configuration Mode' %}">{% trans "IPv6 Address Configuration Mode" %}<dt>
      {% if subnet.ipv6_modes_desc %}
        <dd>{{ subnet.ipv6_modes_desc }}</dd>
      {% else %}
        <dd>{% blocktrans trimmed with ra_mode=subnet.ipv6_ra_mode addr_mode=subnet.ipv6_address_mode %}
        Other IPv6 modes: ipv6_ra_mode={{ ra_mode }}, ipv6_address_mode={{ addr_mode }}
        {% endblocktrans %}</dd>
      {% endif %}
    {% endif %}
    <dt title="{% trans 'Additional routes' %}">{% trans "Additional routes" %}</dt>
    <dd>
      {% for route in subnet.host_routes %}
        {% trans "Destination" %} {{ route.destination }}
        {% trans " : Next hop" %} {{ route.nexthop }}<br>
        {% empty %}
        {% trans "None" %}
      {% endfor %}
    </dd>
    <dt title="{% trans 'DNS name server' %}">{% trans "DNS name server" %}</dt>
    <dd>
      {% for dns in subnet.dns_nameservers %}
        {{ dns }}
        {% empty %}
        {% trans "None" %}
      {% endfor %}
    </dd>
  </dl>
</div>
