mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-28 06:46:59 -05:00
29 lines
1.4 KiB
HTML
29 lines
1.4 KiB
HTML
{% if suggestions %}
|
|
<div class="w-full bg-white rounded-md shadow-lg border border-gray-200 max-h-96 overflow-y-auto"
|
|
x-show="open"
|
|
x-cloak
|
|
@keydown.escape.window="open = false"
|
|
x-transition:enter="transition ease-out duration-100"
|
|
x-transition:enter-start="transform opacity-0 scale-95"
|
|
x-transition:enter-end="transform opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-75"
|
|
x-transition:leave-start="transform opacity-100 scale-100"
|
|
x-transition:leave-end="transform opacity-0 scale-95">
|
|
{% for park in suggestions %}
|
|
<a href="{% url 'parks:park_detail' slug=park.slug %}"
|
|
class="block px-4 py-2 text-sm hover:bg-gray-100 cursor-pointer flex items-center justify-between"
|
|
:class="{ 'bg-gray-100': focusedIndex === {{ forloop.counter0 }} }"
|
|
hx-get="{% url 'parks:search_parks' %}?search={{ park.name }}&view_mode={{ view_mode|default:'grid' }}"
|
|
hx-target="#park-results"
|
|
hx-push-url="true"
|
|
@mousedown.prevent
|
|
@click="query = '{{ park.name }}'; open = false">
|
|
<span class="font-medium">{{ park.name }}</span>
|
|
<span class="text-gray-500">
|
|
{% if park.location.first.city %}{{ park.location.first.city }}, {% endif %}
|
|
{% if park.location.first.state %}{{ park.location.first.state }}{% endif %}
|
|
</span>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %} |