{% load i18n sizeformat %}

<div class="detail">
  <dl class="dl-horizontal">
    <dt title="{% trans 'Name' %}">{% trans "Name" %}</dt>
    <dd class="word-wrap">{{ subnet.name|default:_("None") }}</dd>
    <dt title="{% trans 'ID' %}">{% trans "ID" %}</dt>
    <dd data-display="{{ subnet.name_or_id }}">{{subnet.id|default:_("None") }}</dd>
    <dt>{% trans "Project ID" %}</dt>
    <dd>{{ subnet.tenant_id|default:_("-") }}</dd>
    <dt title="{% trans 'Network Name' %}">{% trans "Network Name" %}</dt>
    <dd class="word-wrap">{{ 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 'Subnet Pool' %}">{% trans "Subnet Pool" %}</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 Pools' %}">{% trans "IP Allocation Pools" %}</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 Enabled' %}">{% trans "DHCP Enabled" %}</dt>
    <dd>{{ subnet.is_dhcp_enabled|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 Servers' %}">{% trans "DNS Name Servers" %}</dt>
    <dd>
      {% for dns in subnet.dns_nameservers %}
        {{ dns }}
        {% empty %}
        {% trans "None" %}
      {% endfor %}
    </dd>
  </dl>
</div>
