|
@@ -1,4 +1,5 @@
|
|
|
{% extends 'ipam/prefix/base.html' %}
|
|
{% extends 'ipam/prefix/base.html' %}
|
|
|
|
|
+{% load humanize %}
|
|
|
{% load helpers %}
|
|
{% load helpers %}
|
|
|
{% load plugins %}
|
|
{% load plugins %}
|
|
|
|
|
|
|
@@ -124,9 +125,18 @@
|
|
|
<a href="{% url 'ipam:prefix_ipaddresses' pk=object.pk %}">{{ child_ip_count }}</a>
|
|
<a href="{% url 'ipam:prefix_ipaddresses' pk=object.pk %}">{{ child_ip_count }}</a>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
|
|
+ {% endwith %}
|
|
|
|
|
+ {% with available_count=object.get_available_ips.size %}
|
|
|
<tr>
|
|
<tr>
|
|
|
<th scope="row">Available IPs</th>
|
|
<th scope="row">Available IPs</th>
|
|
|
- <td>{{ object.get_available_ips|length }}</td>
|
|
|
|
|
|
|
+ <td>
|
|
|
|
|
+ {# Use human-friendly words for counts greater than one million #}
|
|
|
|
|
+ {% if available_count > 1000000 %}
|
|
|
|
|
+ {{ available_count|intword }}
|
|
|
|
|
+ {% else %}
|
|
|
|
|
+ {{ available_count|intcomma }}
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ </td>
|
|
|
</tr>
|
|
</tr>
|
|
|
{% endwith %}
|
|
{% endwith %}
|
|
|
<tr>
|
|
<tr>
|