2017-12-02 21:45:47 +03:00
|
|
|
:: /app/collection/hoon
|
|
|
|
::
|
2017-12-16 01:52:30 +03:00
|
|
|
/- hall, *collections
|
2017-12-16 02:30:44 +03:00
|
|
|
/+ hall, rekey
|
|
|
|
/= cols
|
|
|
|
/: /===/web/collections
|
|
|
|
/^ collections
|
2017-12-16 03:33:34 +03:00
|
|
|
/; (rekey %da) /^ (map knot collection:collections)
|
2017-12-16 04:05:23 +03:00
|
|
|
/_ /. /@ /collections-config/
|
2017-12-16 02:30:44 +03:00
|
|
|
/= tops
|
2017-12-16 03:33:34 +03:00
|
|
|
/; (rekey %da) /^ (map knot topicful:collections)
|
2017-12-16 04:05:23 +03:00
|
|
|
/_ /. /@ /collections-topic/
|
2017-12-16 02:30:44 +03:00
|
|
|
/= comt
|
|
|
|
/; (rekey %da)
|
2017-12-16 04:05:23 +03:00
|
|
|
/_ /@ /collections-comment/
|
2017-12-16 02:30:44 +03:00
|
|
|
== ==
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-15 04:10:58 +03:00
|
|
|
:: things to keep in sync, unique by date:
|
2017-12-16 02:30:44 +03:00
|
|
|
:: collections: files, circles,
|
|
|
|
:: topics: files, circles, notify
|
|
|
|
:: comments: files, notify
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
2017-12-11 22:59:44 +03:00
|
|
|
:: filepaths:
|
2017-12-05 00:34:44 +03:00
|
|
|
:: /web/collections/my-coll.config
|
|
|
|
:: /web/collections/my-coll/some.topic
|
|
|
|
:: /web/collections/my-coll/some/1.comment
|
|
|
|
::
|
2017-12-11 22:59:44 +03:00
|
|
|
:: notification circles:
|
2017-12-14 03:04:45 +03:00
|
|
|
:: ~.collections_blog-date new/changed post notifications
|
|
|
|
:: ~.collections_blog-date__post-date new/changed comments notifications
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-14 03:04:45 +03:00
|
|
|
::
|
|
|
|
::::
|
|
|
|
::
|
|
|
|
:: XX belongs back in zuse
|
|
|
|
|%
|
|
|
|
++ pack :: light path encoding
|
|
|
|
|= {a/term b/path} ^- knot
|
|
|
|
%+ rap 3 :- (wack a)
|
|
|
|
(turn b |=(c/knot (cat 3 '_' (wack c))))
|
|
|
|
::
|
|
|
|
++ pick :: light path decoding
|
|
|
|
=+ fel=(most cab (sear wick urt:ab))
|
|
|
|
|=(a/knot `(unit {p/term q/path})`(rush a fel))
|
|
|
|
::
|
|
|
|
--
|
2017-12-02 21:45:47 +03:00
|
|
|
=> |%
|
2017-12-11 22:59:44 +03:00
|
|
|
++ move (pair bone card) :: all actions
|
2017-12-02 21:45:47 +03:00
|
|
|
++ poke ::
|
|
|
|
$% {$hall-action action:hall} ::
|
|
|
|
== ::
|
|
|
|
++ card ::
|
2017-12-15 04:10:58 +03:00
|
|
|
$% {$info wire ship term nori:clay} ::
|
2017-12-02 21:45:47 +03:00
|
|
|
{$poke wire dock poke} ::
|
|
|
|
{$pull wire dock $~} ::
|
2017-12-11 22:59:44 +03:00
|
|
|
{$warp wire sock riff:clay} ::
|
2017-12-02 21:45:47 +03:00
|
|
|
{$quit $~} ::
|
|
|
|
== ::
|
|
|
|
--
|
|
|
|
::
|
2017-12-14 03:04:45 +03:00
|
|
|
::::
|
|
|
|
::
|
|
|
|
=, wired
|
|
|
|
=, space:userlib
|
2017-12-16 02:30:44 +03:00
|
|
|
|_ {bol/bowl:gall upd/@da}
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-11 22:59:44 +03:00
|
|
|
++ prep ::< prepare state
|
|
|
|
::> adapts state.
|
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
::REVIEW this seems like not the ideal place to get the ford update
|
|
|
|
|= old/(unit @da)
|
2017-12-11 22:59:44 +03:00
|
|
|
^- (quip move _..prep)
|
2017-12-16 02:30:44 +03:00
|
|
|
=^ mow ..prep
|
|
|
|
ta-done:(ta-update:ta (fall old *@da))
|
|
|
|
[mow ..prep(upd now.bol)]
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
|
|
|
++ poke-noun
|
2017-12-14 06:09:00 +03:00
|
|
|
|= a=$@(?(~ @da) [p=@da q=@da])
|
2017-12-02 21:45:47 +03:00
|
|
|
^- (quip move _+>)
|
|
|
|
~& %poked
|
2017-12-14 06:09:00 +03:00
|
|
|
=< ta-done
|
2017-12-14 04:23:42 +03:00
|
|
|
?~ a
|
2017-12-14 06:09:00 +03:00
|
|
|
(ta-create:ta %fora ['a description' pub=& vis=& [~palzod ~ ~]])
|
|
|
|
?@ a
|
|
|
|
(ta-submit:ta a 'a topic' ~['with contents'])
|
|
|
|
(ta-comment:ta p.a q.a now.bol ~['a comment' 'yo'])
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-11 22:59:44 +03:00
|
|
|
++ writ
|
|
|
|
|= {wir/wire rit/riot:clay}
|
|
|
|
^- (quip move _+>)
|
|
|
|
[~ +>]
|
|
|
|
::TODO watch for file changes. create on new files, update on change, delete
|
|
|
|
:: on remove. we want to watch /web/collections recursively if possible,
|
|
|
|
:: or /web/collections/[col] for each collection and then
|
|
|
|
:: /web/collections/[col]/[top] for each topic as they get created.
|
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ignore-action
|
2017-12-16 01:52:30 +03:00
|
|
|
|= act=action:api ^- ?
|
2017-12-13 05:48:57 +03:00
|
|
|
?- -.act
|
|
|
|
?($create $delete)
|
|
|
|
?: (team:title our.bol src.bol) |
|
|
|
|
~|([%unauthorized -.act src.bol] !!)
|
|
|
|
::
|
|
|
|
?($submit $comment)
|
|
|
|
=/ col (~(get by cols) col.act)
|
|
|
|
?~ col &
|
|
|
|
?: publ.conf.u.col
|
|
|
|
(~(has in mems.conf.u.col) src.bol) :: not on blacklist
|
|
|
|
!(~(has in mems.conf.u.col) src.bol) :: is on whitelist
|
|
|
|
==
|
|
|
|
::
|
2017-12-02 21:45:47 +03:00
|
|
|
++ poke-collections-action
|
2017-12-16 01:52:30 +03:00
|
|
|
|= act=action:api
|
2017-12-13 05:48:57 +03:00
|
|
|
^- (quip move _+>)
|
|
|
|
?: (ignore-action act)
|
2017-12-05 00:47:41 +03:00
|
|
|
[~ +>]
|
2017-12-05 00:34:44 +03:00
|
|
|
=< ta-done
|
2017-12-02 21:45:47 +03:00
|
|
|
?- -.act
|
2017-12-05 00:34:44 +03:00
|
|
|
$create (ta-create:ta +.act)
|
|
|
|
$submit (ta-submit:ta +.act)
|
|
|
|
$comment (ta-comment:ta +.act)
|
|
|
|
$delete (ta-delete:ta +.act)
|
2017-12-02 21:45:47 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta
|
|
|
|
|_ moves/(list move)
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ta-done [(flop moves) +>]
|
|
|
|
++ ta-emit |=(mov/move %_(+> moves [mov moves]))
|
|
|
|
++ ta-emil |=(mos/(list move) %_(+> moves (welp (flop mos) moves)))
|
2017-12-02 21:45:47 +03:00
|
|
|
++ ta-hall-action
|
2017-12-13 05:48:57 +03:00
|
|
|
|= act=action:hall
|
2017-12-02 21:45:47 +03:00
|
|
|
%- ta-emit
|
2017-12-11 22:59:44 +03:00
|
|
|
:^ ost.bol %poke / ::TODO wire, handle ++coup.
|
2017-12-02 21:45:47 +03:00
|
|
|
:+ [our.bol %hall] %hall-action
|
|
|
|
act
|
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ta-hall-actions
|
|
|
|
|= act=(list ?(~ action:hall)) ^+ +>
|
|
|
|
?~ act +>
|
|
|
|
?~ i.act $(act t.act)
|
|
|
|
$(act t.act, +> (ta-hall-action i.act)) ::TODO group at all?
|
|
|
|
::
|
2017-12-05 00:34:44 +03:00
|
|
|
:: %performing-actions
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-05 00:34:44 +03:00
|
|
|
++ ta-create
|
2017-12-16 01:52:30 +03:00
|
|
|
|= {wat/kind:api cof/config}
|
2017-12-02 21:45:47 +03:00
|
|
|
^+ +>
|
2017-12-13 05:48:57 +03:00
|
|
|
::XX unhandled kind
|
2017-12-16 05:06:29 +03:00
|
|
|
(ta-write /config now.bol %collections-config !>(cof))
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-05 00:34:44 +03:00
|
|
|
++ ta-submit
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time tit/cord wat/wain}
|
2017-12-16 02:30:44 +03:00
|
|
|
::TODO %resubmit topic edit command?
|
2017-12-16 04:05:23 +03:00
|
|
|
=/ top/topic [tit src.bol wat]
|
2017-12-16 05:06:29 +03:00
|
|
|
(ta-write /topic [col now.bol] %collections-topic !>(top))
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
|
|
|
++ ta-comment
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time top/@da com/@da wat/wain}
|
2017-12-05 00:34:44 +03:00
|
|
|
^+ +>
|
2017-12-16 02:30:44 +03:00
|
|
|
=; res/$@(~ _+>.$) ?^(res res +>.$)
|
|
|
|
%+ biff (~(get by cols) col)
|
2017-12-16 04:05:23 +03:00
|
|
|
|= [^ tops=(map @da topicful) ~]
|
|
|
|
%+ biff (~(get by tops) top)
|
|
|
|
|= [^ cos=(map @da {@da comment}) ~]
|
|
|
|
=/ old/{@da comment}
|
|
|
|
(fall (~(get by cos) com) [now.bol src.bol wat])
|
2017-12-16 05:06:29 +03:00
|
|
|
?. =(who.old src.bol) ..ta-comment ::REVIEW error?
|
|
|
|
%^ ta-write /comment
|
|
|
|
[col top com]
|
|
|
|
[%collections-comment !>(`comment`+.old(wat wat))]
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
|
|
|
++ ta-delete
|
2017-12-14 03:04:45 +03:00
|
|
|
|= col/time
|
2017-12-05 00:34:44 +03:00
|
|
|
^+ +>
|
|
|
|
+>
|
|
|
|
::TODO - delete files
|
2017-12-11 22:59:44 +03:00
|
|
|
:: - unsubscribe from clay
|
2017-12-05 00:34:44 +03:00
|
|
|
:: - send delete action to hall
|
|
|
|
:: - remove from state
|
|
|
|
::
|
|
|
|
:: %writing-files
|
|
|
|
::
|
2017-12-16 05:06:29 +03:00
|
|
|
++ ta-rel-path
|
|
|
|
|= $@(col=time [col=time $@(top=@da [top=@da com=@da])])
|
|
|
|
?- +<
|
|
|
|
@ (weld (dray /[%da] col) /collections-config)
|
|
|
|
{@ @} (weld (dray /[%da]/[%da] col top) /collections-topic)
|
|
|
|
{@ @ @} (weld (dray /[%da]/[%da]/[%da] col top com) /collections-comment)
|
|
|
|
==
|
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ta-write
|
2017-12-16 05:06:29 +03:00
|
|
|
|= [wir=[term ~] loc=?(@ {@ @} {@ @ @}) cay=cage] ^+ +>
|
|
|
|
=/ pax (weld base-path (ta-rel-path loc))
|
2017-12-13 05:48:57 +03:00
|
|
|
%+ ta-emit ost.bol
|
|
|
|
[%info (weld wir pax) our.bol (foal pax cay)]
|
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
:: %applying-changes
|
|
|
|
::
|
|
|
|
++ ta-this .
|
|
|
|
++ ta-update
|
|
|
|
|= wen=@da
|
|
|
|
=. upd wen
|
|
|
|
=/ cos ~(tap by cols)
|
|
|
|
|- ^+ ta-this
|
|
|
|
?~ cos ta-this
|
|
|
|
=. ta-done $(cos t.cos)
|
|
|
|
=+ `[col=@da collection]`i.cos
|
2017-12-16 04:05:23 +03:00
|
|
|
=? ta-this (gth mod.conf upd)
|
2017-12-16 02:30:44 +03:00
|
|
|
(ta-change-config col conf)
|
|
|
|
=/ tos ~(tap by tops)
|
|
|
|
|- ^+ ta-this
|
|
|
|
?~ tos ta-this
|
|
|
|
=. ta-done $(tos t.tos)
|
|
|
|
=+ `[top=@da topicful]`i.tos
|
2017-12-16 04:05:23 +03:00
|
|
|
=? ta-this (gth mod.info upd)
|
2017-12-16 02:30:44 +03:00
|
|
|
(ta-change-topic col top info)
|
|
|
|
=/ mos ~(tap by comt)
|
|
|
|
|- ^+ ta-this
|
|
|
|
?~ mos ta-this
|
|
|
|
=. ta-done $(mos t.mos)
|
2017-12-16 04:05:23 +03:00
|
|
|
=+ `[com=@da cot=[mod=@da comment]]`i.mos
|
|
|
|
=? ta-this (gth mod.cot upd)
|
2017-12-16 02:30:44 +03:00
|
|
|
(ta-change-comment col top com cot)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
++ ta-change-config
|
2017-12-16 04:05:23 +03:00
|
|
|
|= {col/time @da new/config}
|
2017-12-16 02:30:44 +03:00
|
|
|
^+ +>
|
|
|
|
::
|
|
|
|
:: if we don't have it yet, add to hall.
|
|
|
|
=/ old (old-config col) ::TODO convert other two
|
|
|
|
?~ old
|
|
|
|
(ta-hall-create col new)
|
|
|
|
:: update config in hall.
|
|
|
|
=/ nam (circle-for col)
|
|
|
|
%- ta-hall-actions :~
|
|
|
|
?: =(desc.new desc.u.old) ~
|
|
|
|
[%depict nam desc.new]
|
|
|
|
::
|
|
|
|
?: =(visi.new visi.u.old) ~
|
|
|
|
[%public visi.new our.bol nam]
|
|
|
|
::
|
|
|
|
(hall-permit nam & (~(dif in mems.new) mems.u.old))
|
|
|
|
(hall-permit nam | (~(dif in mems.u.old) mems.new))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-change-topic
|
2017-12-16 04:05:23 +03:00
|
|
|
|= {col/time wen/@da @da top/topic}
|
2017-12-16 02:30:44 +03:00
|
|
|
^+ +>
|
|
|
|
=/ new ?=(~ (old-topic col wen))
|
|
|
|
=? +>.$ new
|
|
|
|
=/ cos (~(got by cols) col)
|
2017-12-16 04:05:23 +03:00
|
|
|
(ta-hall-create-topic col wen +.conf.cos)
|
2017-12-16 02:30:44 +03:00
|
|
|
(ta-hall-notify col wen ~ new wat.top)
|
|
|
|
::
|
|
|
|
++ ta-change-comment
|
2017-12-16 04:05:23 +03:00
|
|
|
|= {col/time top/@da wen/@da @da com/comment}
|
2017-12-16 02:30:44 +03:00
|
|
|
^+ +>
|
|
|
|
=/ new =(~ (old-comment col top wen))
|
|
|
|
(ta-hall-notify col top `wen new wat.com)
|
|
|
|
::
|
2017-12-05 00:34:44 +03:00
|
|
|
:: %hall-changes
|
|
|
|
::
|
|
|
|
++ ta-hall-create
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time cof/config}
|
2017-12-05 00:34:44 +03:00
|
|
|
^+ +>
|
2017-12-13 05:48:57 +03:00
|
|
|
=+ nam=(circle-for col)
|
2017-12-15 04:10:58 +03:00
|
|
|
(ta-hall-configure nam cof)
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ta-hall-create-topic
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time top/@da cof/config}
|
2017-12-02 21:45:47 +03:00
|
|
|
^+ +>
|
2017-12-13 05:48:57 +03:00
|
|
|
=+ nam=(circle-for-topic col top)
|
|
|
|
=. +>.$ (ta-hall-configure nam cof)
|
2017-12-02 21:45:47 +03:00
|
|
|
%- ta-hall-action
|
2017-12-13 05:48:57 +03:00
|
|
|
::NOTE %source also subs to local config & presence, but
|
|
|
|
:: that generally won't result in visible notifications.
|
|
|
|
:^ %source (circle-for col) &
|
|
|
|
(sy `source:hall`[our.bol nam]~ ~)
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ ta-hall-configure
|
|
|
|
|= [nam=term cof=config] ^+ +>
|
2017-12-02 21:45:47 +03:00
|
|
|
^+ +>
|
2017-12-13 05:48:57 +03:00
|
|
|
%- ta-hall-actions :~
|
|
|
|
[%create nam desc.cof ?:(publ.cof %journal %village)]
|
|
|
|
?.(visi.cof ~ [%public & our.bol nam])
|
|
|
|
(hall-permit nam & mems.cof)
|
|
|
|
==
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
|
|
|
++ ta-hall-notify
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time top/@da com/(unit @da) new/? wat/wain}
|
2017-12-05 00:34:44 +03:00
|
|
|
^+ +>
|
|
|
|
%- ta-hall-action
|
|
|
|
=- :+ %phrase [[our.bol tar] ~ ~]
|
|
|
|
[%fat [%text wat] [%lin | msg]]~
|
|
|
|
^- {tar/naem:hall msg/cord}
|
|
|
|
::TODO
|
2017-12-13 05:48:57 +03:00
|
|
|
[(circle-for col) 'TODO']
|
2017-12-02 21:45:47 +03:00
|
|
|
--
|
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
++ hall-permit
|
|
|
|
|= [nam=term inv=? sis=(set ship)]
|
|
|
|
?~ sis ~
|
|
|
|
[%permit nam inv sis]
|
2017-12-02 21:45:47 +03:00
|
|
|
::
|
2017-12-13 05:48:57 +03:00
|
|
|
::
|
|
|
|
++ circle-for
|
2017-12-14 03:04:45 +03:00
|
|
|
|=(col/time (pack %collection (dray /[%da] col)))
|
2017-12-13 05:48:57 +03:00
|
|
|
::
|
|
|
|
++ circle-for-topic
|
2017-12-14 03:04:45 +03:00
|
|
|
|=({col/time top/time} (pack %collection (dray /[%da]/[%da] col top)))
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
++ base-path (en-beam:format byk.bol(r da+upd) /collections/web)
|
2017-12-05 00:34:44 +03:00
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
++ old-config
|
2017-12-14 03:04:45 +03:00
|
|
|
|= col/time
|
2017-12-05 00:34:44 +03:00
|
|
|
^- (unit config)
|
2017-12-14 03:04:45 +03:00
|
|
|
=/ pax :(weld base-path (dray /[%da] col) /collections-config)
|
2017-12-13 05:48:57 +03:00
|
|
|
::
|
2017-12-14 03:04:45 +03:00
|
|
|
?~ (file pax) ~
|
2017-12-05 00:34:44 +03:00
|
|
|
`.^(config %cx pax)
|
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
++ old-topic
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time top/@da}
|
2017-12-05 00:34:44 +03:00
|
|
|
^- (unit topic)
|
2017-12-14 03:04:45 +03:00
|
|
|
=/ pax :(weld base-path (dray /[%da]/[%da] col top) /collections-topic)
|
2017-12-13 05:48:57 +03:00
|
|
|
::
|
2017-12-14 03:04:45 +03:00
|
|
|
?~ (file pax) ~
|
2017-12-05 00:34:44 +03:00
|
|
|
`.^(topic %cx pax)
|
|
|
|
::
|
2017-12-16 02:30:44 +03:00
|
|
|
++ old-comment
|
2017-12-14 03:04:45 +03:00
|
|
|
|= {col/time top/@da com/@da}
|
2017-12-05 00:34:44 +03:00
|
|
|
^- (unit comment)
|
2017-12-14 03:04:45 +03:00
|
|
|
=/ pax
|
|
|
|
:(weld base-path (dray /[%da]/[%da]/[%da] col top com) /collections-comment)
|
2017-12-13 05:48:57 +03:00
|
|
|
::
|
2017-12-14 03:04:45 +03:00
|
|
|
?~ (file pax) ~
|
2017-12-05 00:34:44 +03:00
|
|
|
`.^(comment %cx pax)
|
2017-12-02 21:45:47 +03:00
|
|
|
--
|