mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-23 11:31:09 -05:00
Fix moderation submission display:
- Add location map template for view mode - Add coaster fields template for stats - Fix location and stats display in both view and edit modes
This commit is contained in:
23
templates/moderation/partials/location_map.html
Normal file
23
templates/moderation/partials/location_map.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% load moderation_tags %}
|
||||
|
||||
<div class="p-4 bg-gray-100 border rounded-lg dark:bg-gray-900 border-gray-200/50 dark:border-gray-700/50">
|
||||
<h3 class="mb-4 text-lg font-semibold">Location</h3>
|
||||
<div class="h-[300px] w-full rounded-lg border border-gray-300 dark:border-gray-600"
|
||||
id="viewMap-{{ submission.id }}"
|
||||
x-init="setTimeout(() => {
|
||||
const map = L.map('viewMap-{{ submission.id }}').setView([{{ location.latitude }}, {{ location.longitude }}], 13);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
L.marker([{{ location.latitude }}, {{ location.longitude }}]).addTo(map);
|
||||
}, 100)"></div>
|
||||
<div class="mt-4 space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
{% if location.street_address %}<div>{{ location.street_address }}</div>{% endif %}
|
||||
<div>
|
||||
{% if location.city %}{{ location.city }}{% endif %}
|
||||
{% if location.state %}, {{ location.state }}{% endif %}
|
||||
{% if location.postal_code %} {{ location.postal_code }}{% endif %}
|
||||
</div>
|
||||
{% if location.country %}<div>{{ location.country }}</div>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user