Files @ 87d2821ecdfd
Branch filter:

Location: conntrackt/conntrackt/templates/conntrackt/entity_detail.html

branko
CONNT-9: Reworked the entity details view to be more consistent with the other views. Move implicit queries from template to view.
{% extends "conntrackt/base.html" %}

{# For html_link. #}
{% load conntrackt_tags %}

{% block content %}

{% if entity %}
<div class="row">
  <h1 class="span12">{{entity.name}}</h1>
</div>

{% if entity.description %}
<div class="row">
  <div class="span12">
    {{entity.description}}
  </div>
</div>
<hr>
{% endif %}

<div class="row">
  <div class="span12">
    {% html_link "Edit" "entity_update" entity.id class="btn btn-primary" %}
    {% html_link "Remove" "entity_delete" entity.id class="btn btn-primary" %}
    {% html_link "Get Iptables" 'entity_iptables' entity.id class="btn btn-primary" %}
  </div>
</div>

<hr>

<div class="row">

  <div class="span6">
    <div class="well">
      <table class="table table-striped">
        <tr>
          <th colspan="2">General information</th>
        </tr>
        <tr>
          <th>Project</th><td style="width:99%">{% html_link project.name 'project'  project.id  %}</td>
        </tr>
        <tr>
          <th>Location</th><td>{{location}}</td>
        </tr>
      </table>
    </div>
  </div>

  <div class="span6">
    <div class="well">
      <table class="table table-striped">
        <tr>
          <th style="width:99%">Interfaces</th>
        </tr>
        <tr>
          {% for interface in interfaces %}
            <td>{{interface.name}} ({{interface.address}}/{{interface.netmask}})</td>
          {% endfor %}
        </tr>
      </table>
    </div>
  </div>
</div>

<div class="row">
  <div class="span6">
    <div class="well">
      <table class="table table-striped">
        <tr>
          <th>Incoming communications</th>
        </tr>
        {% for comm in incoming_communications %}
          <tr><td>{{comm.source}} - {{comm.protocol}}: {{comm.port}}</td></tr>
        {% endfor %}
      </table>
    </div>
  </div>

  <div class="span6">
    <div class="well">
      <table class="table table-striped">
        <tr>
          <th>Outgoing communications</th>
        </tr>
        {% for comm in outgoing_communications %}
          <tr><td>{{comm.destination}} - {{comm.protocol}}: {{comm.port}}</td></tr>
        {% endfor %}
        <tr>
        </tr>
      </table>
    </div>
  </div>

  <div class="span12">
    <div>
      <p><strong>Iptables rules</strong></p>
      <pre>{{ entity_iptables }}</pre>
    </div>
  </div>
  
</div>
{% endif %}
{% endblock %}