Skip to content

Commit

Permalink
Declare generic hx-target-error globally
Browse files Browse the repository at this point in the history
  • Loading branch information
podliashanyk committed Jan 19, 2024
1 parent 906b12c commit 3af047b
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/howitz/error_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def handle_generic_http_exception(e):
alert_id=alert_random_id, short_err_msg=short_err_msg))

response.headers['HX-Reswap'] = 'beforeend'
response.headers['HX-Retarget'] = 'body'

return response, e.code

Expand Down Expand Up @@ -48,6 +47,5 @@ def handle_generic_exception(e):
alert_id=alert_random_id, short_err_msg=short_err_msg))

response.headers['HX-Reswap'] = 'beforeend'
response.headers['HX-Retarget'] = 'body'

return response, 500
1 change: 0 additions & 1 deletion src/howitz/templates/components/row/collapse-btn.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
hx-get="/events/{{ id }}/collapse_row"
hx-trigger="click"
hx-swap="multi:#event-accordion-row-{{ id }}:outerHTML,#event-details-row-{{ id }}:delete"
hx-target-error="body"
hx-indicator="#row-{{ id }}-indicator"
>

Expand Down
1 change: 0 additions & 1 deletion src/howitz/templates/components/row/event-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
hx-get="/events/{{ id }}/expand_row"
hx-trigger="dblclick"
hx-target="#event-accordion-row-{{ id }}"
hx-target-error="body"
hx-swap="outerHTML"
>
{% with padding='px-3 py-2' %}
Expand Down
1 change: 0 additions & 1 deletion src/howitz/templates/components/row/expand-btn.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
hx-get="/events/{{ id }}/expand_row"
hx-trigger="click"
hx-target="#event-accordion-row-{{ id }}"
hx-target-error="body"
hx-swap="outerHTML"
hx-indicator="#row-{{ id }}-indicator"
>
Expand Down
1 change: 0 additions & 1 deletion src/howitz/templates/components/row/expanded-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
hx-get="/events/{{ id }}/collapse_row"
hx-trigger="dblclick"
hx-swap="multi:#event-accordion-row-{{ id }}:outerHTML,#event-details-row-{{ id }}:delete"
hx-target-error="body"
>

{% with padding='px-3 py-2' %}
Expand Down
1 change: 0 additions & 1 deletion src/howitz/templates/components/table/events-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
hx-swap="innerHTML"
hx-target="#eventlist-list"
hx-trigger="load"
hx-target-error="body"
>
<thead class="text-xs text-center text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-300">
<tr>
Expand Down
3 changes: 2 additions & 1 deletion src/howitz/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

</head>
<body
hx-ext="[{% block extensions %}{% endblock %}]"
hx-ext="{% block extensions %}{% endblock %}"
class="h-full"
hx-target-error="body"
>
{% block content %} {% endblock content %}

Expand Down
3 changes: 1 addition & 2 deletions src/howitz/templates/views/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block page_title %} Events {% endblock %}

{% block extensions %} class-tools, multi-swap, disable-element, loading-states, response-targets {% endblock %}
{% block extensions %}class-tools, multi-swap, disable-element, loading-states, response-targets{% endblock %}


{% block content %}
Expand All @@ -18,7 +18,6 @@ <h1 class="sr-only">Events table</h1>
hx-trigger="load"
role="status"
class="htmx-indicator animate-pulse"
hx-target-error="body"
>

<span class="sr-only">Loading Table...</span>
Expand Down
2 changes: 1 addition & 1 deletion src/howitz/templates/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block page_title %} Login {% endblock %}

{% block extensions %} class-tools, multi-swap, disable-element, loading-states, response-targets {% endblock %}
{% block extensions %}class-tools, multi-swap, disable-element, loading-states, response-targets{% endblock %}

{% block content %}

Expand Down

0 comments on commit 3af047b

Please sign in to comment.