Clean up presentation of port mappings under front/rear port detail views

This commit is contained in:
Jeremy Stretch
2025-12-09 11:21:22 -05:00
parent 80d177fe54
commit ba5c854257
2 changed files with 38 additions and 16 deletions

View File

@@ -62,14 +62,25 @@
</div> </div>
<div class="col col-12 col-md-6"> <div class="col col-12 col-md-6">
<div class="card"> <div class="card">
<h2 class="card-header">{% trans "Rear Ports" %}</h2> <h2 class="card-header">{% trans "Port Mappings" %}</h2>
<table class="table table-hover"> <table class="table table-hover">
{% if rear_port_mappings %}
<thead>
<tr>
<th>{% trans "Position" %}</th>
<th>{% trans "Rear Port" %}</th>
</tr>
</thead>
{% endif %}
{% for mapping in rear_port_mappings %} {% for mapping in rear_port_mappings %}
<tr> <tr>
<td>{{ mapping.front_port_position }}</td> <td>{{ mapping.front_port_position }}</td>
<td>{{ mapping.rear_port|linkify }}</td> <td>
<td>{{ mapping.rear_port_position }}</td> <a href="{{ mapping.rear_port.get_absolute_url }}">{{ mapping.rear_port }}:{{ mapping.rear_port_position }}</a>
</td>
</tr> </tr>
{% empty %}
{% trans "No mappings defined" %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>

View File

@@ -62,14 +62,25 @@
</div> </div>
<div class="col col-12 col-md-6"> <div class="col col-12 col-md-6">
<div class="card"> <div class="card">
<h2 class="card-header">{% trans "Rear Ports" %}</h2> <h2 class="card-header">{% trans "Port Mappings" %}</h2>
<table class="table table-hover"> <table class="table table-hover">
{% if front_port_mappings %}
<thead>
<tr>
<th>{% trans "Position" %}</th>
<th>{% trans "Front Port" %}</th>
</tr>
</thead>
{% endif %}
{% for mapping in front_port_mappings %} {% for mapping in front_port_mappings %}
<tr> <tr>
<td>{{ mapping.rear_port_position }}</td> <td>{{ mapping.rear_port_position }}</td>
<td>{{ mapping.front_port|linkify }}</td> <td>
<td>{{ mapping.front_port_position }}</td> <a href="{{ mapping.front_port.get_absolute_url }}">{{ mapping.front_port }}:{{ mapping.front_port_position }}</a>
</td>
</tr> </tr>
{% empty %}
{% trans "No mappings defined" %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>