{% load i18n sizeformat parse_date %}

<div class="detail">
  <dl class="dl-horizontal">
    <dt>{% trans "Name" %}</dt>
    <dd>{{ vpnservice.name|default:_("None") }}</dd>

    <dt>{% trans "Description" %}</dt>
    <dd>{{ vpnservice.description|default:_("None") }}</dd>

    <dt>{% trans "ID" %}</dt>
    <dd>{{ vpnservice.id }}</dd>

    <dt>{% trans "Project ID" %}</dt>
    <dd>{{ vpnservice.tenant_id }}</dd>

    <dt>{% trans "Router ID" %}</dt>
    {% url 'horizon:project:routers:detail' vpnservice.router_id as router_url %}
    <dd><a href="{{ router_url }}">{{ vpnservice.router.name_or_id }}</a></dd>

    <dt>{% trans "Subnet ID" %}</dt>
    {% url 'horizon:project:networks:subnets:detail' vpnservice.subnet_id as subnet_url %}
    <dd><a href="{{ subnet_url }}">{{ vpnservice.subnet.name_or_id }} {{ vpnservice.subnet.cidr }}</a></dd>

    <dt>{% trans "VPN Connections" %}</dt>
    <dd>
      {% if vpnservice.ipsecsiteconns %}
        {% for conn in vpnservice.ipsecsiteconns %}
        {% url 'horizon:project:vpn:ipsecsiteconnectiondetails' conn.id as conn_url %}
        <a href="{{ conn_url }}">{{ conn.name_or_id }}</a><br>
        {% endfor %}
      {% else %}
        None
      {% endif %}
    </dd>

    <dt>{% trans "Admin State" %}</dt>
    <dd>{{ vpnservice.admin_state_up }}</dd>

    <dt>{% trans "Status" %}</dt>
    <dd>{{ vpnservice.status }}</dd>
  </dl>

  {% if vpnservice.external_v4_ip or vpnservice.external_v6_ip %}
    <h4>Local Side Public IP Addresses</h4>
    <hr class="header_rule">
    <dl class="dl-horizontal">
      <dt>{% trans "IPv4" %}</dt>
      <dd>{{ vpnservice.external_v4_ip|default:_("None") }}</dd>
      <dt>{% trans "IPv6" %}</dt>
      <dd>{{ vpnservice.external_v6_ip|default:_("None") }}</dd>
    </dl>
  {% endif %}
</div>
