1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

11305 Add GPS coordinates to device (#12782)

* 11305 add lat/long to devices

* 11305 update docs

* 11305 update tests
This commit is contained in:
Arthur Hanson
2023-06-14 11:18:50 -07:00
committed by GitHub
parent 2e2ff09822
commit 4f76dcd2ea
12 changed files with 86 additions and 15 deletions

View File

@@ -76,6 +76,23 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">GPS Coordinates</th>
<td class="position-relative">
{% if object.latitude and object.longitude %}
{% if config.MAPS_URL %}
<div class="position-absolute top-50 end-0 translate-middle-y noprint">
<a href="{{ config.MAPS_URL }}{{ object.latitude }},{{ object.longitude }}" target="_blank" class="btn btn-primary btn-sm">
<i class="mdi mdi-map-marker"></i> Map It
</a>
</div>
{% endif %}
<span>{{ object.latitude }}, {{ object.longitude }}</span>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<td>

View File

@@ -53,6 +53,8 @@
{% else %}
{% render_field form.face %}
{% render_field form.position %}
{% render_field form.latitude %}
{% render_field form.longitude %}
{% endif %}
</div>