Clean up cable trace view

This commit is contained in:
jeremystretch 2021-07-29 10:08:43 -04:00
parent 2fa010e291
commit 967c4b9523

View File

@ -6,16 +6,15 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col col-md-5"> <div class="col col-md-5">
<div class="text-center my-3">
<object data="{{ svg_url }}" class="rack_elevation"></object> <object data="{{ svg_url }}" class="rack_elevation"></object>
<div class="text-center mt-3"> <a class="btn btn-outline-primary btn-sm my-3" href="{{ svg_url }}">
<a class="btn btn-outline-primary btn-sm" href="{{ svg_url }}">
<i class="mdi mdi-file-download"></i> Download SVG <i class="mdi mdi-file-download"></i> Download SVG
</a> </a>
</div> </div>
<div class="cable-trace"> <div class="trace-end">
{% with traced_path=path.origin.trace %} {% with traced_path=path.origin.trace %}
{% if path.is_split %} {% if path.is_split %}
<div class="trace-end">
<h3 class="text-danger">Path split!</h3> <h3 class="text-danger">Path split!</h3>
<p>Select a node below to continue:</p> <p>Select a node below to continue:</p>
<ul class="text-start"> <ul class="text-start">
@ -30,20 +29,25 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</div>
{% else %} {% else %}
<div class="trace-end"> <h3 class="text-center text-success">Trace Completed</h3>
<h3 class="text-success">Trace Completed</h3> <table class="table">
<h5>Total Segments: {{ traced_path|length }}</h5> <tr>
<h5>Total Length: <th scope="row">Total segments</th>
<td>{{ traced_path|length }}</td>
</tr>
<tr>
<th scope="row">Total length</th>
<td>
{% if total_length %} {% if total_length %}
{{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters / {{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters /
{{ total_length|meters_to_feet|floatformat:"-2" }} Feet {{ total_length|meters_to_feet|floatformat:"-2" }} Feet
{% else %} {% else %}
<span class="text-muted">N/A</span> <span class="text-muted">N/A</span>
{% endif %} {% endif %}
</h5> </td>
</div> </tr>
</table>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
</div> </div>