Use hyperscript for rendering notifications
This commit is contained in:
@@ -61,10 +61,9 @@
|
||||
|
||||
<form class="w-full mt-3" hx-post="{{ url_for('create_person') }}" hx-swap="beforeend" hx-target="#new-person"
|
||||
_="on htmx:afterRequest
|
||||
js
|
||||
displayNotification('User added')
|
||||
end
|
||||
then reset() me">
|
||||
render #notification-template with (message: 'User added') then append it to #notifications-container
|
||||
then call _hyperscript.processNode(#notifications-container)
|
||||
then reset() me">
|
||||
<div class="flex flex-wrap -mx-3 mb-2">
|
||||
<div class="grow px-3">
|
||||
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-city">
|
||||
@@ -151,9 +150,8 @@
|
||||
|
||||
<form class="w-full mt-8" hx-post="{{ url_for('create_exercise') }}" hx-swap="beforeend"
|
||||
hx-target="#new-exercise" _="on htmx:afterRequest
|
||||
js
|
||||
displayNotification('Exercise added')
|
||||
end
|
||||
render #notification-template with (message: 'Exercise added') then append it to #notifications-container
|
||||
then call _hyperscript.processNode(#notifications-container)
|
||||
then reset() me">
|
||||
<div class="flex flex-wrap -mx-3 mb-2">
|
||||
<div class="grow px-3">
|
||||
|
||||
Reference in New Issue
Block a user