{% load i18n sizeformat parse_date %}

<div class="detail">
  <dl class="dl-horizontal">
    <dt>{% trans "ID" %}</dt>
    <dd>{{ vip.id }}</dd>

    <dt>{% trans "Name" %}</dt>
    <dd>{{ vip.name|default:_("-") }}</dd>

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

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

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

    <dt>{% trans "Address" %}</dt>
    <dd>{{ vip.address }}</dd>

    {% if vip.fip %}
    <dt>{% trans "Floating IP" %}</dt>
    <dd>{{ vip.fip.floating_ip_address }}</dd>
    {% endif %}

    <dt>{% trans "Protocol Port" %}</dt>
    <dd>{{ vip.protocol_port }}</dd>

    <dt>{% trans "Protocol" %}</dt>
    <dd>{{ vip.protocol }}</dd>

    <dt>{% trans "Pool" %}</dt>
    {% url 'horizon:project:loadbalancers:pooldetails' vip.pool_id as pool_url %}
    <dd><a href="{{ pool_url }}">{{ vip.pool.name_or_id }}</a></dd>

    <dt>{% trans "Port ID" %}</dt>
    {% url 'horizon:project:networks:ports:detail' vip.port_id as port_url %}
    <dd><a href="{{ port_url }}">{{ vip.port_id }}</a></dd>

    <dt>{% trans "Session Persistence" %}</dt>
    {% if vip.session_persistence %}
    <dd>
      {% blocktrans with persistence_type=vip.session_persistence.type %}Type: {{ persistence_type }}{% endblocktrans %}
    </dd>

    {% if vip.session_persistence.cookie_name %}
    <dd>
      {% blocktrans with cookie_name=vip.session_persistence.cookie_name %}Cookie Name: {{ cookie_name }}{% endblocktrans %}
    </dd>
    {% endif %}
    {% else %}
    <dd>{% trans "None" %}</dd>
    {% endif %}

    <dt>{% trans "Connection Limit" %}</dt>
    <dd>{{ vip.connection_limit }}</dd>

    <dt>{% trans "Admin State Up" %}</dt>
    <dd>{{ vip.admin_state_up|yesno|capfirst }}</dd>

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