mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:31:09 -05:00
pycountry integration?
This commit is contained in:
@@ -17,7 +17,21 @@
|
||||
<label for="{{ field.id_for_label }}" class="block mb-1 text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
{% if field.field.widget.input_type == 'text' or field.field.widget.input_type == 'date' %}
|
||||
{% if field.name == 'country' %}
|
||||
<div class="relative">
|
||||
<input type="text"
|
||||
name="{{ field.name }}"
|
||||
id="country-input"
|
||||
value="{{ field.value|default:'' }}"
|
||||
class="w-full border-gray-300 rounded-lg form-input dark:border-gray-600 dark:bg-gray-700 dark:text-white"
|
||||
hx-get="{% url 'parks:search_countries' %}"
|
||||
hx-trigger="keyup changed delay:200ms"
|
||||
hx-target="#country-results"
|
||||
hx-params="q"
|
||||
{% if field.field.required %}required{% endif %}>
|
||||
<div id="country-results" class="relative"></div>
|
||||
</div>
|
||||
{% elif field.field.widget.input_type == 'text' or field.field.widget.input_type == 'date' %}
|
||||
<input type="{{ field.field.widget.input_type }}"
|
||||
name="{{ field.name }}"
|
||||
id="{{ field.id_for_label }}"
|
||||
|
||||
Reference in New Issue
Block a user