Add standardized HTMX conventions, interaction patterns, and migration guide for ThrillWiki UX

This commit is contained in:
pacnpal
2025-12-22 16:56:27 -05:00
parent 2e35f8c5d9
commit ae31e889d7
144 changed files with 25792 additions and 4440 deletions

View File

@@ -1,30 +1,4 @@
{# Park header status badge partial - refreshes via HTMX on park-status-changed #}
<span id="park-header-badge"
hx-get="{% url 'parks:park_header_badge' park.slug %}"
hx-trigger="park-status-changed from:body"
hx-swap="outerHTML">
{% if perms.parks.change_park %}
<!-- Clickable status badge for moderators -->
<button type="button"
onclick="document.getElementById('park-status-section').scrollIntoView({behavior: 'smooth'})"
class="status-badge text-sm font-medium py-1 px-3 transition-all hover:ring-2 hover:ring-blue-500 cursor-pointer
{% if park.status == 'OPERATING' %}status-operating
{% elif park.status == 'CLOSED_TEMP' or park.status == 'CLOSED_PERM' %}status-closed
{% elif park.status == 'UNDER_CONSTRUCTION' %}status-construction
{% elif park.status == 'DEMOLISHED' %}status-demolished
{% elif park.status == 'RELOCATED' %}status-relocated{% endif %}">
{{ park.get_status_display }}
<i class="fas fa-chevron-down ml-1 text-xs"></i>
</button>
{% else %}
<!-- Static status badge for non-moderators -->
<span class="status-badge text-sm font-medium py-1 px-3
{% if park.status == 'OPERATING' %}status-operating
{% elif park.status == 'CLOSED_TEMP' or park.status == 'CLOSED_PERM' %}status-closed
{% elif park.status == 'UNDER_CONSTRUCTION' %}status-construction
{% elif park.status == 'DEMOLISHED' %}status-demolished
{% elif park.status == 'RELOCATED' %}status-relocated{% endif %}">
{{ park.get_status_display }}
</span>
{% endif %}
</span>
{# Uses unified status_badge component for consistent styling #}
{% include "components/status_badge.html" with status=park.status badge_id='park-header-badge' refresh_url=park.get_header_badge_url|default:'' refresh_trigger='park-status-changed' scroll_target='park-status-section' can_edit=perms.parks.change_park %}