dm-htmx progress, doesn't display kids correctly

This commit is contained in:
hanfel-dovned 2024-06-05 16:07:23 -07:00
parent fcc4789239
commit 193eb4e3d2
3 changed files with 81 additions and 2 deletions

View File

@ -0,0 +1,19 @@
/@ message
/- feather-icons
/- messages
:- [%ship %$ %htmx]
|= =ship
|= =bowl:neo
^- manx
::~& > bowl :: this sigpam results in endless http spinning
;div.p2
=label "Chat"
;div.ma.fc.g2
=style "max-width: 650px;"
;div.fc.g2
=id "children"
;+ (render-messages:messages bowl)
==
;+ (render-sender:messages [bowl /pub])
==
==

View File

@ -4,5 +4,4 @@
:- [%node %$ %txt]
|= nod=node
^- txt
(~(vol manx-utils nod) "text")
(~(vol manx-utils nod) "text")

View File

@ -0,0 +1,61 @@
/@ message
|%
++ render-messages
|= =bowl:neo
^- manx
;div
=label "Messages"
;*
%+ turn
%+ sort
%+ murn
~(tap of:neo kids.bowl)
|= [=pith =idea:neo]
?~ pith ~
?@ -.pith ~
?. =(-<.pith %da) ~
`[pith idea]
|= [a=[=pith *] b=[=pith *]]
(lth ->.pith.a ->.pith.b)
render-message
==
::
++ render-message
|= [pax=pith =idea:neo]
=/ msg !<(message q.pail.idea)
^- manx
;div.fc.g2.border.p3.br1
;div.fr.ac.jb
;p.s-2.f3: {(scow %p from.msg)}
;p.s-2.f3: {(scow %da now.msg)}
==
;p: {(trip contents.msg)}
==
::
++ render-sender
|= [=bowl:neo location=pith]
^- manx
;form.fc.g2
=hx-post "{(en-tape:pith:neo :(welp /neo/hawk here.bowl location))}?stud=txt"
=hx-on-submit "this.reset()"
=hx-target "find button .loading"
=hx-swap "outerHTML"
=head "msg"
;textarea.p2.border.br1
=name "text"
=placeholder ". . ."
=oninput "this.setAttribute('value', this.value)"
=rows "4"
=required ""
=autocomplete "off"
;
==
;button.p2.b1.br1.bd1.wfc.hover.loader
;span.loaded.s2: create
;span.loading
;+ loading.feather-icons
==
==
==
::
--