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 tracing */
.cable-trace { .cable-trace {
max-width: 600px; max-width: 600px;
margin: 16px auto;
text-align: center; text-align: center;
} }
.cable-trace .node { .cable-trace .node {

View File

@ -7,7 +7,8 @@
{% block content %} {% block content %}
<div class="row"> <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 %} {% with traced_path=path.origin.trace %}
{% for near_end, cable, far_end in traced_path %} {% for near_end, cable, far_end in traced_path %}
@ -57,26 +58,55 @@
{% else %} {% else %}
<span class="text-muted">N/A</span> <span class="text-muted">N/A</span>
{% endif %} {% endif %}
<h5> </h5>
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endwith %} {% endwith %}
</div> </div>
</div>
<div class="col-md-7 col-sm-12"> <div class="col-md-7 col-sm-12">
<h4 class="text-center">Related Paths</h4> <div class="panel panel-default">
<ul class="nav nav-pills nav-stacked"> <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 %} {% 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 }}"> <a href="?cablepath_id={{ cablepath.pk }}">
From {{ cablepath.origin }} ({{ cablepath.origin.parent }}) {{ cablepath.origin.parent }} / {{ cablepath.origin }}
to {{ cablepath.destination }} ({{ cablepath.destination.parent }})
</a> </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 %} {% endfor %}
</ul> </tbody>
</table>
</div>
</div> </div>
</div> </div>