{% load i18n sizeformat parse_date %}
{% load url from future %}

<div class="info row detail">
  <hr class="header_rule">
  <dl>
    <dt>{% trans "Name" %}</dt>
    <dd>{{ rule.name|default:_("-") }}</dd>

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

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

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

    <dt>{% trans "Action" %}</dt>
    <dd>{{ rule.action|upper }}</dd>

    <dt>{% trans "Protocol" %}</dt>
    <dd>{{ rule.protocol|default:_("ANY")|upper }}</dd>

    <dt>{% trans "Source IP Address" %}</dt>
    <dd>{{ rule.source_ip_address|default:_("ANY") }}</dd>

    <dt>{% trans "Source Port" %}</dt>
    <dd>{{ rule.source_port|default:_("ANY") }}</dd>

    <dt>{% trans "Destination IP Address" %}</dt>
    <dd>{{ rule.destination_ip_address|default:_("ANY") }}</dd>

    <dt>{% trans "Destination Port"%}</dt>
    <dd>{{ rule.destination_port|default:_("ANY") }}</dd>

    <dt>{% trans "Used in Policy" %}</dt>
    <dd>
      {% if rule.policy %}
      {% url 'horizon:project:firewalls:policydetails' rule.policy.id as policy_url %}
      <a href="{{ policy_url }}">{{ rule.policy.name|default:rule.policy.id }}</a>
      {% else %}
      {% trans "-" %}
      {% endif %}
    </dd>

    <dt>{% trans "Position in Policy" %}</dt>
    <dd>{{ rule.position|default:_("-") }}</dd>

    <dt>{% trans "Shared" %}</dt>
    <dd>{{ rule.shared|yesno|capfirst }}</dd>

    <dt>{% trans "Enabled" %}</dt>
    <dd>{{ rule.enabled|yesno|capfirst }}</dd>
  </dl>
</div>
