Browse Source

Show related networks in web-WHOIS output for an AS

Sebastian Lohff 2 years ago
parent
commit
dc144fba79
2 changed files with 21 additions and 1 deletions
  1. 18
    0
      templates/whoisdb/handle_panel.html
  2. 3
    1
      templates/whoisdb/handle_show.html

+ 18
- 0
templates/whoisdb/handle_panel.html View File

@@ -15,6 +15,24 @@
15 15
 			</div>
16 16
             <div class="panel-body">
17 17
                 {% include "whoisdb/handle_table.html" with object=object %}
18
+
19
+
20
+				{% if showRelated %}
21
+					{% comment %}Show related objects{% endcomment %}
22
+					{% if object.getClassName == "ASNumber" %}
23
+						{% if object.inetnum_set.all %}
24
+							<h5>Networks originating from this AS</h5>
25
+
26
+							<ul>
27
+							{% for net in object.inetnum_set.all %}
28
+								<li><a href="{% url "whoisdb:showhandle" net.handle %}">{{ net }} ({{ net.prefix }})</a></li>
29
+							{% endfor %}
30
+							</ul>
31
+						{% endif %}
32
+					{% endif %}
33
+				{% endif %}
34
+
35
+
18 36
             </div>
19 37
         </div>
20 38
 	{% endwith %}

+ 3
- 1
templates/whoisdb/handle_show.html View File

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

Loading…
Cancel
Save