mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
Refactor rack elevation template to use htmx for dynamic loading and improved user experience
This commit is contained in:
parent
e33793dc82
commit
ffacced2b1
@ -1,9 +1,19 @@
|
||||
{% load i18n %}
|
||||
<div style="margin-left: -30px">
|
||||
<object data="{% url 'dcim-api:rack-elevation' pk=object.pk %}?face={{face}}&render=svg{% if extra_params %}&{{ extra_params }}{% endif %}" class="rack_elevation" aria-label="{% trans "Rack elevation" %}"></object>
|
||||
<div
|
||||
hx-get="{% url 'dcim-api:rack-elevation' pk=object.pk %}?face={{ face }}&render=svg{% if extra_params %}&{{ extra_params }}{% endif %}"
|
||||
hx-trigger="intersect"
|
||||
hx-swap="innerHTML"
|
||||
aria-label="{% trans 'Rack elevation' %}"
|
||||
style="margin-left: -30px"
|
||||
>
|
||||
<div class="d-flex justify-content-center align-items-center" style="min-height: 200px; margin-left: 30px;">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Rack Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-3">
|
||||
<a class="btn btn-outline-primary" href="{% url 'dcim-api:rack-elevation' pk=object.pk %}?face={{face}}&render=svg{% if extra_params %}&{{ extra_params }}{% endif %}" hx-boost="false">
|
||||
<i class="mdi mdi-file-download"></i> {% trans "Download SVG" %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user