2021-05-17 16:27:27 -04:00
|
|
|
{% extends 'base/layout.html' %}
|
2018-10-30 16:30:03 -04:00
|
|
|
{% load helpers %}
|
2023-07-29 03:30:25 +07:00
|
|
|
{% load i18n %}
|
2018-10-30 16:30:03 -04:00
|
|
|
|
2023-08-02 14:53:32 -04:00
|
|
|
{% block title %}
|
2023-09-11 16:17:02 -04:00
|
|
|
{% blocktrans trimmed with object_type=object|meta:"verbose_name"|bettertitle %}
|
2023-08-02 14:53:32 -04:00
|
|
|
Cable Trace for {{ object_type }} {{ object }}
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% endblock %}
|
2018-10-30 16:30:03 -04:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="row">
|
2021-09-16 08:56:26 -04:00
|
|
|
|
|
|
|
{# Cable trace SVG & options #}
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-5">
|
2021-09-16 08:56:26 -04:00
|
|
|
{% if path %}
|
2021-07-29 10:08:43 -04:00
|
|
|
<div class="text-center my-3">
|
2022-07-14 10:37:27 -04:00
|
|
|
<object data="{{ svg_url }}" class="rack_elevation"></object>
|
|
|
|
<div>
|
2021-07-29 10:08:43 -04:00
|
|
|
<a class="btn btn-outline-primary btn-sm my-3" href="{{ svg_url }}">
|
2023-07-29 03:30:25 +07:00
|
|
|
<i class="mdi mdi-file-download"></i> {% trans "Download SVG" %}
|
2021-07-14 15:29:04 -04:00
|
|
|
</a>
|
2022-07-14 10:37:27 -04:00
|
|
|
</div>
|
2021-07-14 15:29:04 -04:00
|
|
|
</div>
|
2021-07-29 10:08:43 -04:00
|
|
|
<div class="trace-end">
|
2022-07-18 16:17:16 +02:00
|
|
|
{% if path.is_split %}
|
2023-07-29 03:30:25 +07:00
|
|
|
<h3 class="text-danger">{% trans "Path split" %}!</h3>
|
|
|
|
<p>{% trans "Select a node below to continue" %}:</p>
|
2022-07-18 16:17:16 +02:00
|
|
|
<ul class="text-start">
|
2022-08-31 10:07:10 -04:00
|
|
|
{% for next_node in path.get_split_nodes %}
|
|
|
|
{% if next_node.cable %}
|
|
|
|
{% with viewname=next_node|viewname:"trace" %}
|
|
|
|
<li>
|
|
|
|
<a href="{% url viewname pk=next_node.pk %}">{{ next_node|meta:"verbose_name"|bettertitle }} {{ next_node }}</a>
|
2023-07-29 03:30:25 +07:00
|
|
|
({% trans "Cable" %} {{ next_node.cable|linkify }})
|
2022-08-31 10:07:10 -04:00
|
|
|
</li>
|
|
|
|
{% endwith %}
|
|
|
|
{% else %}
|
|
|
|
<li class="text-muted">{{ next_node }}</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2022-07-18 16:17:16 +02:00
|
|
|
</ul>
|
|
|
|
{% else %}
|
2023-07-29 03:30:25 +07:00
|
|
|
<h3 class="text-center text-success">{% trans "Trace Completed" %}</h3>
|
2022-07-18 16:17:16 +02:00
|
|
|
<table class="table">
|
|
|
|
<tr>
|
2023-07-29 03:30:25 +07:00
|
|
|
<th scope="row">{% trans "Total segments" %}</th>
|
2022-07-18 16:17:16 +02:00
|
|
|
<td>{{ path.segment_count }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2023-07-29 03:30:25 +07:00
|
|
|
<th scope="row">{% trans "Total length" %}</th>
|
2022-07-18 16:17:16 +02:00
|
|
|
<td>
|
|
|
|
{% if total_length %}
|
2023-09-11 15:59:50 -04:00
|
|
|
{{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} {% trans "Meters" %} /
|
|
|
|
{{ total_length|meters_to_feet|floatformat:"-2" }} {% trans "Feet" %}
|
2022-07-18 16:17:16 +02:00
|
|
|
{% else %}
|
2023-09-11 15:59:50 -04:00
|
|
|
{{ ''|placeholder }}
|
2022-07-18 16:17:16 +02:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
2020-11-13 12:12:25 -05:00
|
|
|
</div>
|
2021-09-16 08:56:26 -04:00
|
|
|
{% else %}
|
|
|
|
<h3 class="text-center text-muted my-3">
|
2023-07-29 03:30:25 +07:00
|
|
|
{% trans "No paths found" %}
|
2021-09-16 08:56:26 -04:00
|
|
|
</h3>
|
|
|
|
{% endif %}
|
2018-10-30 16:30:03 -04:00
|
|
|
</div>
|
2020-10-05 16:03:30 -04:00
|
|
|
|
2021-09-16 08:56:26 -04:00
|
|
|
{# Related paths #}
|
|
|
|
<div class="col col-md-7">
|
2021-04-15 16:53:04 -07:00
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">
|
2023-07-29 03:30:25 +07:00
|
|
|
{% trans "Related Paths" %}
|
2021-04-15 16:53:04 -07:00
|
|
|
</h5>
|
|
|
|
<div class="card-body">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-07-29 03:30:25 +07:00
|
|
|
<th>{% trans "Origin" %}</th>
|
|
|
|
<th>{% trans "Destination" %}</th>
|
|
|
|
<th>{% trans "Segments" %}</th>
|
2020-11-13 12:12:25 -05:00
|
|
|
</tr>
|
2021-04-15 16:53:04 -07:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for cablepath in related_paths %}
|
|
|
|
<tr{% if cablepath.pk == path.pk %} class="info"{% endif %}>
|
|
|
|
<td>
|
2022-07-14 10:37:27 -04:00
|
|
|
<a href="?cablepath_id={{ cablepath.pk }}">{{ cablepath.origins|join:", " }}</a>
|
2021-04-15 16:53:04 -07:00
|
|
|
</td>
|
|
|
|
<td>
|
2022-07-14 10:37:27 -04:00
|
|
|
{% if cablepath.destinations %}
|
|
|
|
{{ cablepath.destinations|join:", " }}
|
2021-04-15 16:53:04 -07:00
|
|
|
{% else %}
|
2023-07-29 03:30:25 +07:00
|
|
|
<span class="text-muted">{% trans "Incomplete" %}</span>
|
2021-04-15 16:53:04 -07:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
2022-07-14 10:37:27 -04:00
|
|
|
<td>
|
2021-04-15 16:53:04 -07:00
|
|
|
{{ cablepath.segment_count }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% empty %}
|
|
|
|
<td colspan="3" class="text-muted">
|
2023-07-29 03:30:25 +07:00
|
|
|
{% trans "None found" %}
|
2021-04-15 16:53:04 -07:00
|
|
|
</td>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2020-11-13 12:12:25 -05:00
|
|
|
</div>
|
2020-10-02 14:54:16 -04:00
|
|
|
</div>
|
2021-09-16 08:56:26 -04:00
|
|
|
|
2020-04-15 17:09:04 -04:00
|
|
|
</div>
|
2018-10-30 16:30:03 -04:00
|
|
|
{% endblock %}
|