Show related networks in web-WHOIS output for an AS

This commit is contained in:
Sebastian Lohff 2018-01-21 18:33:49 +01:00
parent 7c5ddfc6ee
commit dc144fba79
2 changed files with 21 additions and 1 deletions

View File

@ -15,6 +15,24 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% include "whoisdb/handle_table.html" with object=object %} {% include "whoisdb/handle_table.html" with object=object %}
{% if showRelated %}
{% comment %}Show related objects{% endcomment %}
{% if object.getClassName == "ASNumber" %}
{% if object.inetnum_set.all %}
<h5>Networks originating from this AS</h5>
<ul>
{% for net in object.inetnum_set.all %}
<li><a href="{% url "whoisdb:showhandle" net.handle %}">{{ net }} ({{ net.prefix }})</a></li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endif %}
</div> </div>
</div> </div>
{% endwith %} {% endwith %}

View File

@ -3,6 +3,8 @@
{% load handletags %} {% load handletags %}
{% block content %} {% block content %}
{% include "whoisdb/handle_panel.html" with object=object %} {% include "whoisdb/handle_panel.html" with object=object showRelated=True %}
{% endblock %} {% endblock %}