06/11 Update Inspection result will include GPS
This commit is contained in:
@@ -510,6 +510,32 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# ── Submission GPS (admin / director only) ──────────────────────────── #}
|
||||
{% if current_user.role in ['admin', 'director'] and inspection.submit_latitude and inspection.submit_longitude %}
|
||||
{% set _lat = inspection.submit_latitude | float %}
|
||||
{% set _lng = inspection.submit_longitude | float %}
|
||||
{% set _maps_key = config.get('GOOGLE_MAPS_API_KEY', '') %}
|
||||
<div class="mb-4">
|
||||
<div class="lbl mb-1" style="font-size:.72rem;color:#94a3b8;font-weight:500;text-transform:uppercase;letter-spacing:.04em;">
|
||||
<i class="bi bi-geo-alt-fill text-danger me-1"></i>Submission Location
|
||||
</div>
|
||||
{% if _maps_key %}
|
||||
<div style="border-radius:10px;overflow:hidden;border:1px solid #e2e8f0;max-width:420px;">
|
||||
<img src="https://maps.googleapis.com/maps/api/staticmap?center={{ _lat }},{{ _lng }}&zoom=15&size=420x220&maptype=roadmap&markers=color:red%7C{{ _lat }},{{ _lng }}&key={{ _maps_key }}"
|
||||
alt="Submission location map"
|
||||
style="width:100%;display:block;">
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="mt-1" style="font-size:.8rem;color:#64748b;">
|
||||
{{ '%.6f' | format(_lat) }}, {{ '%.6f' | format(_lng) }}
|
||||
<a href="https://www.google.com/maps?q={{ _lat }},{{ _lng }}" target="_blank"
|
||||
class="ms-2 text-decoration-none small">
|
||||
<i class="bi bi-box-arrow-up-right"></i> Open in Maps
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ── Build the filtered field set ──────────────────────────────────────
|
||||
Strategy:
|
||||
1. Find all grid rows that contain at least one rated rating field.
|
||||
|
||||
Reference in New Issue
Block a user