1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Introduce linkify template filter

This commit is contained in:
jeremystretch
2022-03-22 14:51:20 -04:00
parent dc92e19f76
commit 75dae5fbe8
68 changed files with 240 additions and 637 deletions

View File

@@ -17,37 +17,19 @@
</tr>
<tr>
<th scope="row">Type</th>
<td><a href="{{ object.type.get_absolute_url }}">{{ object.type }}</a></td>
<td>{{ object.type|linkify }}</td>
</tr>
<tr>
<th scope="row">Group</th>
<td>
{% if object.group %}
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.group|linkify }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<td>
{% if object.tenant %}
<a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.tenant|linkify }}</td>
</tr>
<tr>
<th scope="row">Site</th>
<td>
{% if object.site %}
<a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.site|linkify }}</td>
</tr>
<tr>
<th scope="row">Virtual Machines</th>

View File

@@ -23,32 +23,20 @@
</tr>
<tr>
<th scope="row">Role</th>
<td>
{% if object.role %}
<a href="{{ object.role.get_absolute_url }}">{{ object.role }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.role|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Platform</th>
<td>
{% if object.platform %}
<a href="{{ object.platform.get_absolute_url }}">{{ object.platform }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.platform|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<td>
{% if object.tenant %}
{% if object.tenant.group %}
<a href="{{ object.tenant.group.get_absolute_url }}">{{ object.tenant.group }}</a> /
{{ object.tenant.group|linkify }} /
{% endif %}
<a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
{{ object.tenant|linkify }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
@@ -103,9 +91,9 @@
<th scope="row">Cluster</th>
<td>
{% if object.cluster.group %}
<a href="{{ object.cluster.group.get_absolute_url }}">{{ object.cluster.group }}</a> /
{{ object.cluster.group|linkify }} /
{% endif %}
<a href="{{ object.cluster.get_absolute_url }}">{{ object.cluster }}</a>
{{ object.cluster|linkify }}
</td>
</tr>
<tr>

View File

@@ -21,9 +21,7 @@
<table class="table table-hover attr-table">
<tr>
<th scope="row">Virtual Machine</th>
<td>
<a href="{{ object.virtual_machine.get_absolute_url }}">{{ object.virtual_machine }}</a>
</td>
<td>{{ object.virtual_machine|linkify }}</td>
</tr>
<tr>
<th scope="row">Name</th>
@@ -41,33 +39,15 @@
</tr>
<tr>
<th scope="row">Parent</th>
<td>
{% if object.parent %}
<a href="{{ object.parent.get_absolute_url }}">{{ object.parent }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Bridge</th>
<td>
{% if object.bridge %}
<a href="{{ object.bridge.get_absolute_url }}">{{ object.bridge }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.bridge|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">VRF</th>
<td>
{% if object.vrf %}
<a href="{{ object.vrf.get_absolute_url }}">{{ object.vrf }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
<td>{{ object.vrf|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>