From 851709058f17487adc833f9b315d2612fd156cf7 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:21:28 -0400 Subject: [PATCH] Refactor location widget and park search results templates to utilize Alpine.js for state management. Enhanced search functionality, improved data binding, and streamlined event handling for better user experience. --- .../moderation/partials/location_widget.html | 540 ++++++++---------- .../partials/manufacturer_search_results.html | 91 +-- .../partials/park_search_results.html | 103 ++-- 3 files changed, 345 insertions(+), 389 deletions(-) diff --git a/templates/moderation/partials/location_widget.html b/templates/moderation/partials/location_widget.html index 71c7805b..ba0e9de4 100644 --- a/templates/moderation/partials/location_widget.html +++ b/templates/moderation/partials/location_widget.html @@ -19,30 +19,60 @@ } -
+

Location

-
+
{# Search Form #}
-
{# Map Container #}
-
@@ -54,9 +84,8 @@ + x-model="formData.street_address" + class="w-full px-4 py-2 text-gray-900 bg-white border rounded-lg dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600 form-input">
+ x-model="formData.city" + class="w-full px-4 py-2 text-gray-900 bg-white border rounded-lg dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600 form-input">
+ x-model="formData.state" + class="w-full px-4 py-2 text-gray-900 bg-white border rounded-lg dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600 form-input">
+ x-model="formData.country" + class="w-full px-4 py-2 text-gray-900 bg-white border rounded-lg dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600 form-input">
+ x-model="formData.postal_code" + class="w-full px-4 py-2 text-gray-900 bg-white border rounded-lg dark:text-gray-300 dark:bg-gray-700 dark:border-gray-600 form-input">
{# Hidden Coordinate Fields #}
diff --git a/templates/moderation/partials/manufacturer_search_results.html b/templates/moderation/partials/manufacturer_search_results.html index fab16400..07760f5f 100644 --- a/templates/moderation/partials/manufacturer_search_results.html +++ b/templates/moderation/partials/manufacturer_search_results.html @@ -1,9 +1,12 @@ -
+
{% if manufacturers %} {% for manufacturer in manufacturers %} {% endfor %} @@ -19,49 +22,49 @@
diff --git a/templates/moderation/partials/park_search_results.html b/templates/moderation/partials/park_search_results.html index f19e4cb1..ae5020ea 100644 --- a/templates/moderation/partials/park_search_results.html +++ b/templates/moderation/partials/park_search_results.html @@ -1,9 +1,12 @@ -
+
{% if parks %} {% for park in parks %} {% endfor %} @@ -19,55 +22,55 @@