{% load i18n sizeformat parse_date %}

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

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

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

		<dt>{% trans "Project ID" %}</dt>
		<dd>{{ policy_rule_set.tenant_id }}</dd>
	</dl>
</div>
{% if rules_with_details %}
<div class="panel panel-default">
	<div class="panel-heading"> {% trans "Policy Rules" %} </div>
	<div class="panel-body">
		<table class="table">
			<thead>
				<th>Name</th>
				<th>ID</th>
				<th>Protocol</th>
				<th>Port</th>
				<th>Direction</th>
				<th>Action</th>
			</thead>
			<tbody>
			{% for rule in rules_with_details %}
			<tr>
				<td>{{rule.name|default:_("-") }}</td>
				<td>{{rule.id}}</td>
				<td>{{rule.classifier.protocol}}</td>
				<td>{{rule.classifier.port_range}}</td>
				<td>{{rule.classifier.direction}}</td>
				<td>&nbsp;
					{% for a in rule.actions %}
                    <a href="{% url 'horizon:project:application_policy:policyactiondetails' policyaction_id=a.id %}">{{a.name}}</a>
					{% endfor %}
				</td>
			</tr>
			{% endfor %}
			</tbody>
		</table>
	</div>
</div>
{% else %}
{% trans "-" %}
{% endif %} 

