Files @ 2a0c8cb4797c
Branch filter:

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

branko
CONNT-5: Added custom model form for Interface. Applied small improvement to EntityForm for styling. Implemented adding interfaces to entities from the entity details page. Updated representation of interfaces on entity details page. Updated view tests for the new functionality. Minor fix to EntityView.
{% 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" %}
    {% with entity_id=entity.id|slugify %}
    {% html_link "Add interface" "interface_create" class="btn btn-primary" get="entity="|add:entity_id %}
    {% endwith %}
  </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>
        {% for interface in interfaces %}
          <tr>
            <td>{{interface.name}} ({{interface.address}}/{{interface.netmask}})</td>
          </tr>
        {% endfor %}
      </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 %}