diff --git a/scipost_django/common/templates/htmx/dynsel.html b/scipost_django/common/templates/htmx/dynsel.html index 91556f2a4d9f2e39de59e34c22c335f550f34b8f..e60baea575782cccb696f3217c01879e48400c10 100644 --- a/scipost_django/common/templates/htmx/dynsel.html +++ b/scipost_django/common/templates/htmx/dynsel.html @@ -9,17 +9,17 @@ </div> {% include "django/forms/widgets/select.html" %} - + <input name="q" value="{{ initial }}" type="text" - hx-post="{{ url }}" + hx-get="{{ url }}" hx-trigger="keyup changed delay:500ms" hx-swap="innerHTML" hx-target="next .result-list" /> </div> - + <ul class="result-list"> </ul> - + </div> diff --git a/scipost_django/common/templates/htmx/dynsel_list_page.html b/scipost_django/common/templates/htmx/dynsel_list_page.html index ea61e616cffc6d986c8d32241ff348cde7d563f7..ed3955d63c96acb31f0d047c7ed96c2cdf02cad5 100644 --- a/scipost_django/common/templates/htmx/dynsel_list_page.html +++ b/scipost_django/common/templates/htmx/dynsel_list_page.html @@ -14,7 +14,7 @@ {% if page_obj.has_next %} <li class="htmx-indicator w-100 d-flex justify-content-center bg-primary bg-opacity-25" - hx-post="{{ request.path }}?page={{ page_obj.next_page_number }}" + hx-get="{{ request.path }}?page={{ page_obj.next_page_number }}" hx-include="previous input" hx-trigger="intersect once" hx-swap="outerHTML" diff --git a/scipost_django/common/views.py b/scipost_django/common/views.py index d979cfdd9a0b6e58162cdef336c53732541772e3..de650ea56ed54f0cd5d076365df2764e17ded745 100644 --- a/scipost_django/common/views.py +++ b/scipost_django/common/views.py @@ -171,9 +171,9 @@ class HXDynselAutocomplete(View): template_name = "htmx/dynsel_list_page.html" paginate_by = 16 - def post(self, request): + def get(self, request): self.page_nr = request.GET.get("page") - self.q = request.POST.get("q", "") + self.q = request.GET.get("q", "") context = self.get_context_data()