redirect after creating chat

This commit is contained in:
SuperCoolYun 2024-06-13 12:53:13 -04:00
parent fb5fa52699
commit 30f673d98c

View File

@ -10,7 +10,7 @@
::
++ view
^- manx
;div.p2.fc.ac.view.g1.ma
;div.p2.fc.ac.view.g2.ma
;style: {style}
;+ make-chat
;+ all-chats
@ -46,25 +46,36 @@
'''
::
++ make-chat
=/ oninput
"""
this.setAttribute("value", this.value); this.nextElementSibling.nextElementSibling.setAttribute('hx-get', '/neo/hawk{(pith-tape here.bowl)}/dms/' + this.value); htmx.process(document.body);
"""
;form.fr.jc.g1.w70
=hx-post "/neo/hawk{(pith-tape here.bowl)}?stud=messenger-diff"
=hx-target "find button .loading"
=hx-swap "outerHTML"
=hx-post "/neo/hawk{(pith-tape here.bowl)}?stud=messenger-diff"
=head "new-dm"
=hx-swap "none"
=hx-on-htmx-after-request "$(this).find('.redirect').emit('messenger-created')"
;input.grow.bc1.p2.br1
=name "invites"
=type "text"
=required ""
=placeholder "~zod ~bus"
=oninput (trip 'this.setAttribute("value", this.value); if (this.value.includes(" ~")){this.parentNode.setAttribute("head", "new-groupchat"); this.nextElementSibling.classList.remove("hidden");}else{this.parentNode.setAttribute("head", "new-dm"); this.nextElementSibling.classList.add("hidden");}')
=autocomplete "off"
;
=name "invites"
=type "text"
=required ""
=placeholder "Start chat (e.g. ~sampel-palnet)"
=oninput oninput
=autocomplete "off"
;
==
;input.hidden.grow.bc1.p2.br1
=type "text"
=name "name"
=placeholder "chat name"
=oninput (trip 'this.setAttribute("value", this.value);')
;
=type "text"
=name "name"
=placeholder "chat name"
=oninput (trip 'this.setAttribute("value", this.value);')
;
==
;div.redirect.hidden
=hx-target "closest .hawk"
=hx-swap "outerHTML"
=hx-trigger "messenger-created"
;
==
;button.loader.br1.hover.p2.b0.bc1
;span.loaded; >
@ -81,7 +92,7 @@
=(p.pail.idea %groupchat)
^- manx
;div.fc.as.g1.w70
;div.fc.ac.g2.wf
;div.fc.ac.g1.wf
;* %+ turn q.kids
|= [=pith =idea:neo]
?~ pith
@ -100,7 +111,7 @@
;h3.s-1.p2: {<ship>}
==
==
;div.fc.ac.g2.wf
;div.fc.ac.g1.wf
;* %+ turn p.kids
|= [=pith =idea:neo]
?~ pith ;span.hidden: no groupchats