Fix up related paths list

This commit is contained in:
Jeremy Stretch 2020-11-13 12:12:25 -05:00
parent eb5f6167a5
commit 424d72a7b3
2 changed files with 93 additions and 62 deletions

View File

@ -230,6 +230,7 @@ table.report th a {
/* Cable tracing */
.cable-trace {
max-width: 600px;
margin: 16px auto;
text-align: center;
}
.cable-trace .node {

View File

@ -7,7 +7,8 @@
{% block content %}
<div class="row">
<div class="col-md-5 col-sm-12 cable-trace">
<div class="col-md-5 col-sm-12">
<div class="cable-trace">
{% with traced_path=path.origin.trace %}
{% for near_end, cable, far_end in traced_path %}
@ -57,26 +58,55 @@
{% else %}
<span class="text-muted">N/A</span>
{% endif %}
<h5>
</h5>
</div>
{% endif %}
{% endfor %}
{% endwith %}
</div>
</div>
<div class="col-md-7 col-sm-12">
<h4 class="text-center">Related Paths</h4>
<ul class="nav nav-pills nav-stacked">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Related Paths</strong>
</div>
<table class="table table-hover panel-body">
<thead>
<tr>
<th>Origin</th>
<th>Destination</th>
<th>Segments</th>
</tr>
</thead>
<tbody>
{% for cablepath in related_paths %}
<li role="presentation"{% if cablepath.pk == path.pk %} class="active"{% endif %}>
<tr{% if cablepath.pk == path.pk %} class="info"{% endif %}>
<td>
<a href="?cablepath_id={{ cablepath.pk }}">
From {{ cablepath.origin }} ({{ cablepath.origin.parent }})
to {{ cablepath.destination }} ({{ cablepath.destination.parent }})
{{ cablepath.origin.parent }} / {{ cablepath.origin }}
</a>
</li>
</td>
<td>
{% if cablepath.destination %}
{{ cablepath.destination }} ({{ cablepath.destination.parent }})
{% else %}
<span class="text-muted">Incomplete</span>
{% endif %}
</td>
<td class="text-right">
{{ cablepath.segment_count }}
</td>
</tr>
{% empty %}
<td colspan="3" class="text-muted">
None found
</td>
{% endfor %}
</ul>
</tbody>
</table>
</div>
</div>
</div>