| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {% extends 'base/layout.html' %}
- {% load helpers %}
- {% block title %}Cable Trace for {{ object|meta:"verbose_name"|bettertitle }} {{ object }}{% endblock %}
- {% block content %}
- <div class="row">
- <div class="col col-md-5">
- <object data="{{ svg_url }}" class="rack_elevation"></object>
- <div class="text-center mt-3">
- <a class="btn btn-outline-primary btn-sm" href="{{ svg_url }}">
- <i class="mdi mdi-file-download"></i> Download SVG
- </a>
- </div>
- <div class="cable-trace">
- {% with traced_path=path.origin.trace %}
- {% if path.is_split %}
- <div class="trace-end">
- <h3 class="text-danger">Path split!</h3>
- <p>Select a node below to continue:</p>
- <ul class="text-start">
- {% for next_node in path.get_split_nodes %}
- {% if next_node.cable %}
- <li>
- <a href="{% url 'dcim:frontport_trace' pk=next_node.pk %}">{{ next_node }}</a>
- (Cable <a href="{{ next_node.cable.get_absolute_url }}">{{ next_node.cable }}</a>)
- </li>
- {% else %}
- <li class="text-muted">{{ next_node }}</li>
- {% endif %}
- {% endfor %}
- </ul>
- </div>
- {% else %}
- <div class="trace-end">
- <h3 class="text-success">Trace Completed</h3>
- <h5>Total Segments: {{ traced_path|length }}</h5>
- <h5>Total Length:
- {% if total_length %}
- {{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters /
- {{ total_length|meters_to_feet|floatformat:"-2" }} Feet
- {% else %}
- <span class="text-muted">N/A</span>
- {% endif %}
- </h5>
- </div>
- {% endif %}
- {% endwith %}
- </div>
- </div>
- <div class="col col-md-7">
- <div class="card">
- <h5 class="card-header">
- Related Paths
- </h5>
- <div class="card-body">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>Origin</th>
- <th>Destination</th>
- <th>Segments</th>
- </tr>
- </thead>
- <tbody>
- {% for cablepath in related_paths %}
- <tr{% if cablepath.pk == path.pk %} class="info"{% endif %}>
- <td>
- <a href="?cablepath_id={{ cablepath.pk }}">
- {{ cablepath.origin.parent_object }} / {{ cablepath.origin }}
- </a>
- </td>
- <td>
- {% if cablepath.destination %}
- {{ cablepath.destination }} ({{ cablepath.destination.parent_object }})
- {% else %}
- <span class="text-muted">Incomplete</span>
- {% endif %}
- </td>
- <td class="text-end">
- {{ cablepath.segment_count }}
- </td>
- </tr>
- {% empty %}
- <td colspan="3" class="text-muted">
- None found
- </td>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- {% endblock %}
|