# HG changeset patch # User Branko Majic # Date 2013-03-16 18:21:10 # Node ID 202776b43053fcbc8db7bdfcf21ab4d194527ee4 # Parent 02c5e6c3ba98adf6df36a9e7f0bb5c228907aaa7 Fixed the listing of incoming connections (destination was displayed instead of source). Switched to using non-styled lists for incoming/outgoing connections. diff --git a/conntrackt/templates/conntrackt/entity_detail.html b/conntrackt/templates/conntrackt/entity_detail.html --- a/conntrackt/templates/conntrackt/entity_detail.html +++ b/conntrackt/templates/conntrackt/entity_detail.html @@ -1,24 +1,28 @@ {% 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 %}

{{entity.name}}

-
Project
{% html_link project.name 'project' project.id %}
-
Location
{% html_link location.name 'location' location.id %}
-
Incoming communications
    {% for interface in entity.interface_set.all %} -{% for communication in interface.destination_set.all %} -
  • {{communication.destination}} - {{communication.protocol}}: {{communication.port}}
  • +
    Project
    {% html_link project.name 'project' project.id %}
    +
    Location
    {% html_link location.name 'location' location.id %}
    +
    Incoming communications
      {% for interface in entity.interface_set.all %} + {% for communication in interface.destination_set.all %} +
    • {{communication.source}} - {{communication.protocol}}: {{communication.port}}
    • + {% endfor %}{% endfor %}
    +
    Outgoing communications
      {% for interface in entity.interface_set.all %} + {% for communication in interface.source_set.all %} +
    • {{communication.destination}} - {{communication.protocol}}: {{communication.port}}
    • {% endfor %}{% endfor %}
    -
    Outgoing communications
      {% for interface in entity.interface_set.all %} -{% for communication in interface.source_set.all %} -
    • {{communication.destination}} - {{communication.protocol}}: {{communication.port}}
    • -{% endfor %}{% endfor %}
    -
    iptables rules
    {% include "conntrackt/entity_iptables.html" with entity=entity %}
    {% html_link 'Download' 'entity_iptables' entity.id class="btn btn-primary" %}
    +
    iptables rules
    {% include "conntrackt/entity_iptables.html" with entity=entity %}
    {% html_link 'Download' 'entity_iptables' entity.id class="btn btn-primary" %}
{% endif %} {% endwith %} -{% endblock %} \ No newline at end of file +{% endblock %} +