{% extends "conntrackt/template.html" %}
{# For html_link. #}
{% load conntrackt %}
{% block content %}
{# Use a bit shorter variable names. #}
{% with project=entity.project location=entity.location %}
{% if entity %}
<h1>{{entity.name}}</h1>
<dl>
<dt>Project</dt><dd>{% html_link project.name 'project' project.id %}</dd>
<dt>Location</dt><dd>{% html_link location.name 'location' location.id %}</dd>
<dt>Incoming communications</dt><dd><ul>{% for interface in entity.interface_set.all %}
{% for communication in interface.destination_set.all %}
<li>{{communication.destination}} - {{communication.protocol}}: {{communication.port}}</li>
<dt>Incoming communications</dt><dd><ul class="unstyled">{% for interface in entity.interface_set.all %}
<li>{{communication.source}} - {{communication.protocol}}: {{communication.port}}</li>
{% endfor %}{% endfor %}</ul></dd>
<dt>Outgoing communications</dt><dd><ul class="unstyled">{% for interface in entity.interface_set.all %}
{% for communication in interface.source_set.all %}
<dt>Outgoing communications</dt><dd><ul>{% for interface in entity.interface_set.all %}
<dt>iptables rules</dt><dd><pre>{% include "conntrackt/entity_iptables.html" with entity=entity %}</pre>{% html_link 'Download' 'entity_iptables' entity.id class="btn btn-primary" %}</dd>
</dl>
{% endif %}
{% endwith %}
{% endblock %}
\ No newline at end of file