mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-24 01:11:08 -05:00
- Add HTMX-powered filtering with instant updates - Add smooth transitions and loading states - Improve visual hierarchy and styling - Add review notes functionality - Add confirmation dialogs for actions - Make navigation sticky - Add hover effects and visual feedback - Improve dark mode support
34 lines
1.4 KiB
HTML
34 lines
1.4 KiB
HTML
<div class="absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-lg shadow-lg dark:bg-gray-700 dark:border-gray-600" style="max-height: 240px; overflow-y: auto;">
|
|
{% if manufacturers %}
|
|
{% for manufacturer in manufacturers %}
|
|
<button type="button"
|
|
class="w-full px-4 py-2 text-left text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-600"
|
|
onclick="selectManufacturer('{{ manufacturer.id }}', '{{ manufacturer.name|escapejs }}')">
|
|
{{ manufacturer.name }}
|
|
</button>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="px-4 py-2 text-gray-700 dark:text-gray-300">
|
|
{% if search_term %}
|
|
No matches found. You can still submit this name.
|
|
{% else %}
|
|
Start typing to search...
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<script>
|
|
function selectManufacturer(id, name) {
|
|
document.getElementById('id_manufacturer').value = id;
|
|
document.getElementById('id_manufacturer_search').value = name;
|
|
document.getElementById('manufacturer-search-results').innerHTML = '';
|
|
|
|
// Update ride model search to include manufacturer
|
|
const rideModelSearch = document.getElementById('id_ride_model_search');
|
|
if (rideModelSearch) {
|
|
rideModelSearch.setAttribute('hx-include', '[name="manufacturer"]');
|
|
}
|
|
}
|
|
</script>
|