2018-07-31 07:00:49 +03:00
|
|
|
::
|
|
|
|
:::: /hoon/collections/lib
|
|
|
|
::
|
|
|
|
/? 309
|
2018-11-07 09:46:39 +03:00
|
|
|
/- hall
|
2018-09-13 00:36:50 +03:00
|
|
|
/+ cram, elem-to-react-json
|
2018-07-31 07:00:49 +03:00
|
|
|
::
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
2018-11-02 06:26:15 +03:00
|
|
|
~% %collections-lib ..is ~
|
2018-07-31 07:00:49 +03:00
|
|
|
|%
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ move [bone card]
|
|
|
|
::
|
|
|
|
+$ card
|
2018-12-13 10:59:53 +03:00
|
|
|
$% [%info wire toro:clay]
|
2018-11-07 09:46:39 +03:00
|
|
|
[%poke wire dock poke]
|
2018-12-13 20:56:56 +03:00
|
|
|
[%perm wire desk path rite:clay]
|
2018-11-13 21:38:56 +03:00
|
|
|
[%peer wire dock path]
|
|
|
|
[%pull wire dock ~]
|
2018-11-16 01:34:46 +03:00
|
|
|
[%diff diff]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ diff
|
|
|
|
$% [%collections-prize prize]
|
|
|
|
[%collections-rumor rumor]
|
2018-11-07 09:46:39 +03:00
|
|
|
==
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
|
|
|
+$ poke
|
2018-11-07 09:46:39 +03:00
|
|
|
$% [%hall-action action:hall]
|
|
|
|
[%collections-action action]
|
|
|
|
[%json json]
|
|
|
|
==
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
|
|
|
+$ state
|
|
|
|
$% [%0 col=collection str=streams]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ streams
|
|
|
|
$: :: inbox config and the last 30 messages in it
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
inbox=[con=(unit config:hall) env=(list envelope:hall)]
|
2018-11-13 21:38:56 +03:00
|
|
|
:: names and configs of all circles we own
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
our-circles=(map circle:hall (unit config:hall))
|
|
|
|
:: names and configs of all circles we're subscribed to
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
sub-circles=(map circle:hall (unit config:hall))
|
2018-11-13 21:38:56 +03:00
|
|
|
:: all the DM invites we've received
|
|
|
|
::
|
|
|
|
invites=(list envelope:hall)
|
2018-11-07 09:46:39 +03:00
|
|
|
==
|
|
|
|
::
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ prize
|
|
|
|
$: :: inbox config and the last 30 messages in it
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
inbox=[con=(unit config:hall) env=(list envelope:hall)]
|
2018-11-13 21:38:56 +03:00
|
|
|
:: names and configs of all circles we own
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
our-circles=(map circle:hall (unit config:hall))
|
|
|
|
:: names and configs of all circles we're subscribed to
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
sub-circles=(map circle:hall (unit config:hall))
|
2018-11-13 21:38:56 +03:00
|
|
|
:: all the DM invites we've received
|
|
|
|
::
|
|
|
|
invites=(list envelope:hall)
|
|
|
|
==
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ rumor
|
|
|
|
$% :: if config is given, either add new circle or update existing one
|
|
|
|
:: if config is nil then delete circle
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
[%circle-change wit=?(%our %sub) cir=circle:hall con=(unit config:hall)]
|
2018-11-13 21:38:56 +03:00
|
|
|
:: recieved a new inbox message or DM invite
|
|
|
|
::
|
2018-11-16 01:34:46 +03:00
|
|
|
[%new-msg nom=?(%inbox %invites) env=envelope:hall]
|
2018-11-13 21:38:56 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ collection [meta=config data=(map nom=knot =item)]
|
|
|
|
::
|
|
|
|
+$ item
|
2018-11-07 09:55:34 +03:00
|
|
|
$~ [%error ~]
|
2018-07-31 07:00:49 +03:00
|
|
|
$% [%collection col=collection]
|
|
|
|
[%raw raw=raw-item]
|
|
|
|
[%both col=collection raw=raw-item]
|
2018-11-07 09:55:34 +03:00
|
|
|
[%error ~]
|
2018-07-31 07:00:49 +03:00
|
|
|
==
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
|
|
|
+$ raw-item
|
2018-11-07 21:47:29 +03:00
|
|
|
$% [%udon meta=(map knot cord) data=@t]
|
2018-07-31 07:00:49 +03:00
|
|
|
==
|
|
|
|
::
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ config
|
2018-07-31 07:00:49 +03:00
|
|
|
$: full-path=beam
|
2018-08-21 00:16:57 +03:00
|
|
|
name=@t
|
2018-07-31 07:00:49 +03:00
|
|
|
description=@t
|
|
|
|
::
|
|
|
|
owner=@p
|
|
|
|
::
|
|
|
|
date-created=@da
|
|
|
|
last-modified=@da
|
|
|
|
::
|
|
|
|
type=@tas
|
|
|
|
comments=?
|
|
|
|
sort-key=(unit @)
|
|
|
|
visible=?
|
|
|
|
::
|
|
|
|
==
|
|
|
|
::
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ action
|
2018-07-31 07:00:49 +03:00
|
|
|
$: who=ship
|
|
|
|
dek=desk
|
|
|
|
acts=(list sub-action)
|
|
|
|
==
|
2018-11-13 21:38:56 +03:00
|
|
|
::
|
|
|
|
+$ sub-action
|
2018-07-31 07:00:49 +03:00
|
|
|
$% [%write pax=path for=form]
|
|
|
|
[%delete pax=path]
|
|
|
|
[%perms pax=path r=rule:clay w=rule:clay]
|
|
|
|
::
|
2018-08-21 00:16:57 +03:00
|
|
|
[%collection pax=path name=@t desc=@t comments=? visible=? type=@tas]
|
2018-09-13 00:36:50 +03:00
|
|
|
[%post pax=path name=@t type=@tas comments=? content=@t edit=?]
|
2018-07-31 07:00:49 +03:00
|
|
|
[%comment pax=path content=@t]
|
|
|
|
==
|
|
|
|
::
|
2018-11-13 21:38:56 +03:00
|
|
|
+$ form
|
2018-11-07 21:47:29 +03:00
|
|
|
$% [%udon @t]
|
2018-08-01 21:32:34 +03:00
|
|
|
[%collections-config config]
|
2018-07-31 07:00:49 +03:00
|
|
|
==
|
2018-11-07 09:55:34 +03:00
|
|
|
::
|
|
|
|
++ collection-error
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-collection-error
|
2018-11-07 09:55:34 +03:00
|
|
|
|= col=collection
|
|
|
|
^- ?
|
|
|
|
|-
|
|
|
|
=/ vals=(list item) ~(val by data.col)
|
|
|
|
%+ roll vals
|
|
|
|
|= [i=item out=_|]
|
|
|
|
^- ?
|
|
|
|
?: out out
|
|
|
|
?+ -.i
|
|
|
|
%.n
|
|
|
|
%error %.y
|
|
|
|
%collection ^$(col col.i)
|
|
|
|
%both ^$(col col.i)
|
|
|
|
==
|
2018-09-13 00:36:50 +03:00
|
|
|
::::
|
|
|
|
:::: /mar/snip
|
|
|
|
::::
|
|
|
|
++ words 1
|
|
|
|
++ hedtal
|
|
|
|
=| met/marl
|
|
|
|
|= a/marl ^- {hed/marl tal/marl}
|
|
|
|
?~ a [~ ~]
|
|
|
|
:: looks like it only terminates if it finds an h1?
|
|
|
|
?. ?=($h1 n.g.i.a)
|
|
|
|
?: ?=($meta n.g.i.a)
|
|
|
|
$(a t.a, met [i.a met])
|
|
|
|
=+ had=$(a c.i.a)
|
|
|
|
?^ -.had had
|
|
|
|
$(a t.a)
|
|
|
|
[c.i.a (weld (flop met) (limit words t.a))]
|
|
|
|
::
|
|
|
|
::
|
|
|
|
++ limit
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-limit
|
2018-09-13 00:36:50 +03:00
|
|
|
|= {lim/@u mal/marl}
|
|
|
|
=< res
|
|
|
|
|- ^- {rem/@u res/marl}
|
|
|
|
?~ mal [lim ~]
|
|
|
|
?~ lim [0 ~]
|
|
|
|
=+ ^- {lam/@u hed/manx}
|
|
|
|
?: ?=(_;/(**) i.mal)
|
|
|
|
[lim ;/(tay)]:(deword lim v.i.a.g.i.mal)
|
|
|
|
[rem ele(c res)]:[ele=i.mal $(mal c.i.mal)]
|
|
|
|
[rem - res]:[hed $(lim lam, mal t.mal)]
|
|
|
|
::
|
|
|
|
++ deword
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-deword
|
2018-09-13 00:36:50 +03:00
|
|
|
|= {lim/@u tay/tape} ^- {lim/@u tay/tape}
|
|
|
|
?~ tay [lim tay]
|
|
|
|
?~ lim [0 ~]
|
|
|
|
=+ wer=(dot 1^1 tay)
|
|
|
|
?~ q.wer
|
|
|
|
[lim - tay]:[i.tay $(tay t.tay)]
|
|
|
|
=+ nex=$(lim (dec lim), tay q.q.u.q.wer)
|
|
|
|
[-.nex [(wonk wer) +.nex]]
|
|
|
|
::
|
|
|
|
:: json
|
|
|
|
::
|
|
|
|
++ item-to-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-item-to-json
|
2018-09-13 00:36:50 +03:00
|
|
|
|= itm=item
|
|
|
|
^- json
|
|
|
|
?- -.itm
|
2018-11-07 09:55:34 +03:00
|
|
|
%error (frond:enjs:format %error ~)
|
2018-09-13 00:36:50 +03:00
|
|
|
::
|
|
|
|
%collection
|
|
|
|
%+ frond:enjs:format
|
|
|
|
%collection (collection-to-json col.itm)
|
|
|
|
::
|
|
|
|
%raw
|
|
|
|
%- frond:enjs:format
|
|
|
|
[%item (raw-to-json raw.itm)]
|
|
|
|
::
|
|
|
|
%both
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ [%item (raw-to-json raw.itm)]
|
|
|
|
[%collection (collection-to-json col.itm)]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ collection-to-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-collection-to-json
|
2018-09-13 00:36:50 +03:00
|
|
|
|= col=collection
|
|
|
|
^- json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ [%meta (config-to-json meta.col)]
|
|
|
|
:+ %data %a
|
|
|
|
%+ turn ~(tap by data.col)
|
|
|
|
|= [nom=knot ite=item]
|
|
|
|
^- json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ [%filename %s nom]
|
|
|
|
[%item (item-to-json ite)]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ raw-to-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-raw-to-json
|
2018-09-13 00:36:50 +03:00
|
|
|
|= raw=raw-item
|
|
|
|
^- json
|
|
|
|
=/ elm=manx elm:(static:cram (ream data.raw))
|
|
|
|
=/ rec=json (elem-to-react-json elm)
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ [%data rec]
|
|
|
|
[%meta (meta-to-json meta.raw)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ config-to-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-config-to-json
|
2018-09-13 00:36:50 +03:00
|
|
|
|= con=config
|
|
|
|
^- json
|
|
|
|
?: =(con *config)
|
|
|
|
~
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ :- %full-path
|
|
|
|
:- %a
|
|
|
|
%+ turn (en-beam:format full-path.con)
|
|
|
|
|= a=@ta
|
|
|
|
[%s a]
|
|
|
|
:- %name [%s name.con]
|
|
|
|
:- %desc [%s description.con]
|
|
|
|
:- %owner (ship:enjs:format owner.con)
|
|
|
|
:- %date-created (time:enjs:format date-created.con)
|
|
|
|
:- %last-modified (time:enjs:format last-modified.con)
|
|
|
|
:- %type [%s type.con]
|
|
|
|
:- %comments [%b comments.con]
|
|
|
|
:- %sort-key ?~(sort-key.con ~ (numb:enjs:format u.sort-key.con))
|
|
|
|
:- %visible [%b visible.con]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ meta-to-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-meta-to-json
|
2018-09-13 00:36:50 +03:00
|
|
|
|= meta=(map knot cord)
|
|
|
|
^- json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
%+ turn ~(tap by meta)
|
|
|
|
|= [key=@t val=@t]
|
|
|
|
^- [@t json]
|
|
|
|
[key [%s val]]
|
2018-07-31 07:00:49 +03:00
|
|
|
::
|
2018-11-07 21:47:29 +03:00
|
|
|
++ udon-to-front
|
|
|
|
~/ %coll-udon-to-front
|
2018-09-22 00:42:58 +03:00
|
|
|
|= u=@t
|
|
|
|
^- (map knot cord)
|
|
|
|
%- ~(run by inf:(static:cram (ream u)))
|
|
|
|
|= a=dime ^- cord
|
|
|
|
?+ (end 3 1 p.a) (scot a)
|
|
|
|
%t q.a
|
|
|
|
==
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
:: +path-to-circle:
|
|
|
|
::
|
|
|
|
:: takes a clay path and returns a hall circle
|
|
|
|
:: for a path /foo/bar it returns a circle with a :name %c-foo-bar
|
|
|
|
::
|
|
|
|
++ path-to-circle
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-path-to-circle
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path our=@p]
|
|
|
|
^- circle:hall
|
|
|
|
=. pax
|
|
|
|
?: ?=([%web %collections *] pax)
|
|
|
|
(weld /c (slag 2 `path`pax))
|
|
|
|
?: ?=([%collections *] pax)
|
|
|
|
(weld /c (slag 1 `path`pax))
|
|
|
|
?: ?=([%c *] pax)
|
|
|
|
`path`pax
|
|
|
|
`path`(weld /c pax)
|
|
|
|
=/ nam=term
|
|
|
|
%+ roll `(list @ta)`pax
|
|
|
|
|= [seg=@ta out=term]
|
|
|
|
%^ cat 3
|
|
|
|
?:(=(%$ out) out (cat 3 out '-'))
|
|
|
|
((hard @tas) seg)
|
|
|
|
[our nam]
|
|
|
|
::
|
|
|
|
:: +allowed-by: checks if ship :who is allowed by the permission rules in :dic
|
|
|
|
::
|
|
|
|
++ allowed-by
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-allowed-by
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [who=@p dic=dict:clay our=@p]
|
|
|
|
^- ?
|
|
|
|
?: =(who our) &
|
|
|
|
=/ in-list=?
|
|
|
|
?| (~(has in p.who.rul.dic) who)
|
|
|
|
::
|
|
|
|
%- ~(rep by q.who.rul.dic)
|
|
|
|
|= [[@ta cru=crew:clay] out=_|]
|
|
|
|
?: out &
|
|
|
|
(~(has in cru) who)
|
|
|
|
==
|
|
|
|
?: =(%black mod.rul.dic)
|
|
|
|
!in-list
|
|
|
|
in-list
|
|
|
|
::
|
|
|
|
:: +collection-notify: XX
|
|
|
|
::
|
|
|
|
++ collection-notify
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-collection-notify
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path conf=config]
|
|
|
|
^- json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ ['owner' [%s (crip (scow %p owner.conf))]]
|
|
|
|
['path' [%a (turn pax |=(a=@ta `json`[%s a]))]]
|
|
|
|
['name' [%s name.conf]]
|
|
|
|
['date' [%s (crip (scow %da last-modified.conf))]]
|
|
|
|
['type' [%s type.conf]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: +item-notify: XX
|
|
|
|
::
|
|
|
|
++ item-notify
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-item-notify
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path raw=raw-item now=@da byk=beak]
|
|
|
|
^- json
|
|
|
|
=/ owner (fall (~(get by meta.raw) %owner) ~.anon)
|
|
|
|
=/ dat (fall (~(get by meta.raw) %last-modified) (scot %da now))
|
|
|
|
=/ nom (fall (~(get by meta.raw) %name) ~.no-title)
|
|
|
|
=/ typ (fall (~(get by meta.raw) %type) ~.no-type)
|
|
|
|
::
|
|
|
|
=/ elm=manx elm:(static:cram (ream data.raw))
|
|
|
|
=/ snip=marl tal:(hedtal +.elm)
|
|
|
|
=/ inner
|
|
|
|
?~ snip
|
|
|
|
(crip (en-xml:html elm))
|
|
|
|
(crip (en-xml:html i.snip)) :: inner html
|
|
|
|
::
|
|
|
|
=/ parent-spur (slag 1 (flop pax))
|
|
|
|
=/ bek=beak byk(r [%da now])
|
|
|
|
=/ parent-path (en-beam:format [bek parent-spur])
|
|
|
|
=/ parent-dir .^(arch %cy parent-path)
|
|
|
|
::
|
|
|
|
=/ parent-conf=json
|
2018-11-07 21:47:29 +03:00
|
|
|
?: (~(has in dir.parent-dir) ~.udon ~)
|
2018-11-07 09:46:39 +03:00
|
|
|
%- meta-to-json
|
2018-11-07 21:47:29 +03:00
|
|
|
%- udon-to-front
|
|
|
|
.^(@t %cx (weld parent-path /udon))
|
2018-11-07 09:46:39 +03:00
|
|
|
?: (~(has in dir.parent-dir) ~.collections-config ~)
|
|
|
|
%- config-to-json
|
|
|
|
.^(config %cx (weld parent-path /collections-config))
|
|
|
|
~
|
|
|
|
::
|
|
|
|
%- pairs:enjs:format
|
|
|
|
:~ ['owner' [%s owner]]
|
|
|
|
['path' [%a (turn pax |=(a=@ta `json`[%s a]))]]
|
|
|
|
['name' [%s nom]]
|
|
|
|
['date' [%s dat]]
|
|
|
|
['type' [%s typ]]
|
|
|
|
['content' [%s data.raw]]
|
|
|
|
['snip' [%s inner]]
|
|
|
|
['parent-config' parent-conf]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: +front-to-wain: XX
|
|
|
|
::
|
|
|
|
++ front-to-wain
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-front-to-wain
|
2018-11-07 09:46:39 +03:00
|
|
|
|= a=(map knot cord)
|
|
|
|
^- wain
|
|
|
|
=/ entries=wain
|
|
|
|
%+ turn ~(tap by a)
|
|
|
|
|= b=[knot cord]
|
|
|
|
=/ c=[term cord] ((hard ,[term cord]) b)
|
|
|
|
(crip " [{<-.c>} {<+.c>}]")
|
|
|
|
::
|
|
|
|
?~ entries ~
|
|
|
|
;: weld
|
|
|
|
[':- :~' ~]
|
|
|
|
entries
|
|
|
|
[' ==' ~]
|
|
|
|
==
|
|
|
|
::
|
2018-11-07 21:47:29 +03:00
|
|
|
:: +update-udon-front: XX
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
2018-11-07 21:47:29 +03:00
|
|
|
++ update-udon-front
|
|
|
|
~/ %coll-update-udon-front
|
|
|
|
|= [fro=(map knot cord) udon=@t]
|
2018-11-07 09:46:39 +03:00
|
|
|
^- @t
|
|
|
|
%- of-wain:format
|
2018-11-07 21:47:29 +03:00
|
|
|
=/ tum (trip udon)
|
2018-11-07 09:46:39 +03:00
|
|
|
=/ id (find ";>" tum)
|
|
|
|
?~ id
|
|
|
|
%+ weld (front-to-wain fro)
|
|
|
|
(to-wain:format (crip (weld ";>\0a" tum)))
|
|
|
|
%+ weld (front-to-wain fro)
|
|
|
|
(to-wain:format (crip (slag u.id tum)))
|
|
|
|
::
|
|
|
|
:: _ta: main event core for collections
|
|
|
|
::
|
|
|
|
++ ta
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta
|
2018-11-07 09:46:39 +03:00
|
|
|
|_ $: moves=(list move)
|
|
|
|
bol=bowl:gall
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: +ta-this: ta core subject
|
|
|
|
::
|
|
|
|
++ ta-this .
|
|
|
|
::
|
|
|
|
:: +ta-done:
|
|
|
|
::
|
|
|
|
:: flop :moves for finalization, since moves are prepended to the list
|
|
|
|
::
|
|
|
|
++ ta-done (flop moves)
|
|
|
|
::
|
|
|
|
:: +ta-emit: add a +move to :moves
|
|
|
|
::
|
|
|
|
++ ta-emit
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-emit
|
2018-11-07 09:46:39 +03:00
|
|
|
|= mov=move
|
|
|
|
%_ ta-this
|
|
|
|
moves [mov moves]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: +ta-emil: add a list of +move to :moves
|
|
|
|
::
|
|
|
|
++ ta-emil
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-emil
|
2018-11-07 09:46:39 +03:00
|
|
|
|= mos=(list move)
|
|
|
|
%_ ta-this
|
|
|
|
moves (welp (flop mos) moves)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: +ta-act: process collection-action
|
|
|
|
::
|
|
|
|
++ ta-act
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-act
|
2018-11-07 09:46:39 +03:00
|
|
|
|= act=action
|
|
|
|
^+ ta-this
|
|
|
|
::
|
|
|
|
:: iterate through list of +sub-action of +action
|
|
|
|
::
|
|
|
|
|-
|
|
|
|
?~ acts.act ta-this
|
|
|
|
=* a i.acts.act
|
|
|
|
::
|
|
|
|
=/ now-id=@da (sub now.bol (div (dis now.bol ~s0..fffe) 2))
|
|
|
|
=/ dat (scot %da now-id)
|
|
|
|
=/ bek=beak byk.bol(r [%da now-id])
|
|
|
|
=/ sap (en-beam:format [bek (flop (path +<.a))])
|
|
|
|
::
|
|
|
|
=. ta-this
|
|
|
|
?- -.a
|
|
|
|
%write
|
|
|
|
=/ perms .^([dict:clay dict:clay] %cp sap)
|
|
|
|
?: (allowed-by src.bol +.perms our.bol)
|
|
|
|
?- -.for.a
|
2018-11-07 21:47:29 +03:00
|
|
|
%udon (ta-write pax.a `cage`[-.for.a !>(+.for.a)])
|
2018-11-07 09:46:39 +03:00
|
|
|
%collections-config (ta-write pax.a `cage`[-.for.a !>(+.for.a)])
|
|
|
|
==
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
%delete
|
|
|
|
=/ perms .^([dict:clay dict:clay] %cp sap)
|
|
|
|
?: (allowed-by src.bol +.perms our.bol)
|
|
|
|
(ta-remove pax.a)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
%perms
|
|
|
|
?: =(src.bol our.bol) :: XX admin privileges for other users?
|
|
|
|
(ta-set-permissions pax.a r.a w.a)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
::
|
|
|
|
:: XX some of this is redunant
|
|
|
|
::
|
|
|
|
%collection
|
|
|
|
=/ perms
|
|
|
|
.^([dict:clay dict:clay] %cp (weld sap /[dat]/collections-config))
|
|
|
|
?. (allowed-by src.bol +.perms our.bol)
|
|
|
|
ta-this
|
|
|
|
=/ conf=config
|
|
|
|
:* [bek (flop (weld pax.a /[dat]/collections-config))]
|
|
|
|
name.a
|
|
|
|
desc.a
|
|
|
|
our.bol
|
|
|
|
now-id
|
|
|
|
now-id
|
|
|
|
type.a
|
|
|
|
comments.a
|
|
|
|
~
|
|
|
|
visible.a
|
|
|
|
==
|
|
|
|
=. ta-this
|
|
|
|
%+ ta-write (weld pax.a /[dat]/collections-config)
|
|
|
|
[%collections-config !>(conf)]
|
|
|
|
:: restrict permissions on config file
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-set-permissions (weld pax.a /[dat]/collections-config)
|
|
|
|
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: read
|
|
|
|
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
|
|
|
:: open permissions on collection items
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-set-permissions (weld pax.a /[dat])
|
|
|
|
[%black ((set whom:clay) ~)] :: read
|
|
|
|
[%black ((set whom:clay) ~)] :: write
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
%post
|
|
|
|
=? pax.a !edit.a
|
|
|
|
(weld pax.a /[dat])
|
|
|
|
=? sap !edit.a
|
|
|
|
(en-beam:format [bek (flop pax.a)])
|
2018-11-07 21:47:29 +03:00
|
|
|
=/ perms .^([dict:clay dict:clay] %cp (weld sap /udon))
|
2018-11-07 09:46:39 +03:00
|
|
|
?. (allowed-by src.bol +.perms our.bol)
|
|
|
|
ta-this
|
|
|
|
=. content.a (crip (weld (trip content.a) "\0a"))
|
|
|
|
=/ front=(map knot cord)
|
|
|
|
%- my
|
|
|
|
:~ [%name name.a]
|
|
|
|
[%comments ?:(comments.a ~..y ~..n)]
|
|
|
|
[%owner (scot %p src.bol)]
|
|
|
|
[%date-created (snag 0 (flop pax.a))]
|
|
|
|
[%last-modified dat]
|
|
|
|
[%type type.a]
|
|
|
|
==
|
|
|
|
=. ta-this
|
2018-11-07 21:47:29 +03:00
|
|
|
%+ ta-write (weld pax.a /udon)
|
|
|
|
[%udon !>((update-udon-front front content.a))]
|
|
|
|
:: restrict permissions on udon file
|
2018-11-07 09:46:39 +03:00
|
|
|
=. ta-this
|
2018-11-07 21:47:29 +03:00
|
|
|
%^ ta-set-permissions (weld pax.a /udon)
|
2018-11-07 09:46:39 +03:00
|
|
|
[%black ((set whom:clay) ~)] :: read
|
|
|
|
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
|
|
|
:: open permissions on comments
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-set-permissions pax.a
|
|
|
|
[%black ((set whom:clay) ~)] :: read
|
|
|
|
[%black ((set whom:clay) ~)] :: write
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
%comment
|
2018-11-07 21:47:29 +03:00
|
|
|
=/ perms .^([dict:clay dict:clay] %cp (weld sap /[dat]/udon))
|
2018-11-07 09:46:39 +03:00
|
|
|
?. (allowed-by src.bol +.perms our.bol)
|
|
|
|
ta-this
|
|
|
|
=. content.a (crip (weld (trip content.a) "\0a"))
|
|
|
|
=/ front=(map knot cord)
|
|
|
|
%- my
|
|
|
|
:~ [%owner (scot %p src.bol)]
|
|
|
|
[%date-created dat]
|
|
|
|
[%last-modified dat]
|
|
|
|
[%type %comments]
|
|
|
|
==
|
|
|
|
=. ta-this
|
2018-11-07 21:47:29 +03:00
|
|
|
%+ ta-write (weld pax.a /[dat]/udon)
|
|
|
|
[%udon !>((update-udon-front front content.a))]
|
|
|
|
:: restrict permissions on udon file
|
2018-11-07 09:46:39 +03:00
|
|
|
=. ta-this
|
2018-11-07 21:47:29 +03:00
|
|
|
%^ ta-set-permissions (weld pax.a /[dat]/udon)
|
2018-11-07 09:46:39 +03:00
|
|
|
[%black ((set whom:clay) ~)] :: read
|
|
|
|
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
==
|
|
|
|
$(acts.act t.acts.act)
|
|
|
|
::
|
|
|
|
:: +ta-update:
|
|
|
|
::
|
|
|
|
::
|
|
|
|
::
|
|
|
|
++ ta-update
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-update
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [old=collection new=collection]
|
|
|
|
^+ ta-this
|
|
|
|
?: =(old new)
|
|
|
|
ta-this
|
|
|
|
(ta-update-collection old new /web/collections)
|
|
|
|
::
|
|
|
|
++ ta-insert-item
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-insert-item
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [new=item pax=path]
|
|
|
|
^+ ta-this
|
|
|
|
=/ parent-path (scag (dec (lent pax)) pax)
|
|
|
|
::
|
|
|
|
?- -.new
|
|
|
|
::
|
|
|
|
%error
|
|
|
|
(ta-hall-lin parent-path 'error')
|
|
|
|
::
|
|
|
|
%collection
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-hall-json parent-path 'new collection'
|
|
|
|
(collection-notify pax meta.col.new)
|
|
|
|
::
|
|
|
|
=. ta-this (ta-hall-create-circle pax description.meta.col.new)
|
|
|
|
=/ items=(list [nom=@ta =item]) ~(tap by data.col.new)
|
|
|
|
|-
|
|
|
|
?~ items ta-this
|
|
|
|
=. ta-this (ta-insert-item item.i.items (weld pax [nom.i.items ~]))
|
|
|
|
$(items t.items)
|
|
|
|
::
|
|
|
|
%both
|
|
|
|
=. ta-this (ta-hall-create-circle pax description.meta.col.new)
|
|
|
|
=/ items=(list [nom=@ta =item]) ~(tap by data.col.new)
|
|
|
|
=. ta-this
|
|
|
|
|-
|
|
|
|
?~ items ta-this
|
|
|
|
=. ta-this (ta-insert-item item.i.items (weld pax [nom.i.items ~]))
|
|
|
|
$(items t.items)
|
|
|
|
::
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
%raw
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-hall-json
|
|
|
|
parent-path
|
|
|
|
'new item'
|
|
|
|
(item-notify pax raw.new now.bol byk.bol)
|
|
|
|
?: ?& (~(has by meta.raw.new) %comments)
|
|
|
|
=('.y' (~(got by meta.raw.new) %comments))
|
|
|
|
==
|
2018-11-20 01:37:00 +03:00
|
|
|
=/ owner=(unit @ta) (~(get by meta.raw.new) %owner)
|
|
|
|
=/ owner-p=@p
|
|
|
|
?~ owner our.bol
|
|
|
|
(fall (rush u.owner ;~(pfix sig fed:ag)) our.bol)
|
|
|
|
(ta-generate-comments pax owner-p)
|
2018-11-07 09:46:39 +03:00
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-remove-item
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-remove-item
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [old=item pax=path]
|
|
|
|
^+ ta-this
|
|
|
|
:: flush permissions
|
|
|
|
:: notify parent of deletion
|
|
|
|
=/ parent (scag (dec (lent pax)) pax)
|
|
|
|
:: recurse for children
|
|
|
|
?- -.old
|
|
|
|
::
|
|
|
|
%error
|
|
|
|
(ta-hall-lin parent 'error')
|
|
|
|
::
|
|
|
|
%collection
|
|
|
|
=. ta-this
|
|
|
|
%^ ta-hall-json parent 'deleted collection'
|
|
|
|
(collection-notify pax meta.col.old)
|
|
|
|
=. ta-this (ta-flush-permissions (weld pax /collections-config))
|
|
|
|
=/ items=(list [nom=@ta =item]) ~(tap by data.col.old)
|
|
|
|
|-
|
|
|
|
?~ items ta-this
|
|
|
|
=. ta-this (ta-remove-item item.i.items (weld pax [nom.i.items ~]))
|
|
|
|
$(items t.items)
|
|
|
|
::
|
|
|
|
%both
|
|
|
|
=. ta-this (ta-flush-permissions pax)
|
|
|
|
=. ta-this (ta-flush-permissions (weld pax /collections-config))
|
|
|
|
=/ items=(list [nom=@ta =item]) ~(tap by data.col.old)
|
|
|
|
|-
|
|
|
|
?~ items ta-this
|
|
|
|
=. ta-this (ta-remove-item item.i.items (weld pax [nom.i.items ~]))
|
|
|
|
$(items t.items)
|
|
|
|
::
|
|
|
|
%raw
|
|
|
|
=. ta-this (ta-flush-permissions pax)
|
|
|
|
%^ ta-hall-json
|
|
|
|
parent
|
|
|
|
'deleted item'
|
|
|
|
(item-notify pax raw.old now.bol byk.bol)
|
|
|
|
::
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::
|
|
|
|
::
|
|
|
|
++ ta-update-item
|
|
|
|
:: always make sure removals happen first and insertions happen last
|
|
|
|
:: because removals flush permissions and insertions set them
|
|
|
|
::
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-update-item
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [old=item new=item pax=path]
|
|
|
|
^+ ta-this
|
|
|
|
?: =(old new)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
:: check for changes in item type
|
|
|
|
?: &(?=(%collection -.old) ?=(%collection -.new))
|
|
|
|
(ta-update-collection col.old col.new pax)
|
|
|
|
?: &(?=(%raw -.old) ?=(%raw -.new))
|
|
|
|
(ta-update-raw-item raw.old raw.new pax)
|
|
|
|
?: &(?=(%both -.old) ?=(%both -.new))
|
|
|
|
:: update raw item
|
|
|
|
=. ta-this (ta-update-collection col.old col.new pax)
|
|
|
|
(ta-update-raw-item raw.old raw.new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%collection -.old) ?=(%raw -.new))
|
|
|
|
:: remove collection
|
|
|
|
:: insert raw item
|
|
|
|
=. ta-this (ta-remove-item old pax)
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%collection -.old) ?=(%both -.new))
|
|
|
|
:: insert raw item
|
|
|
|
:: update-collection
|
|
|
|
=. ta-this (ta-update-collection col.old col.new pax)
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%raw -.old) ?=(%collection -.new))
|
|
|
|
:: remove raw item
|
|
|
|
:: insert collection
|
|
|
|
=. ta-this (ta-remove-item old pax)
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%raw -.old) ?=(%both -.new))
|
|
|
|
:: insert collection
|
|
|
|
:: update raw item
|
|
|
|
=. ta-this (ta-update-raw-item raw.old raw.new pax)
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%both -.old) ?=(%raw -.new))
|
|
|
|
:: remove collection
|
|
|
|
:: update raw item
|
|
|
|
=. ta-this (ta-remove-item [%collection col.old] pax)
|
|
|
|
(ta-update-raw-item raw.old raw.new pax)
|
|
|
|
::
|
|
|
|
?: &(?=(%both -.old) ?=(%collection -.new))
|
|
|
|
:: remove raw item
|
|
|
|
:: update collection
|
|
|
|
=. ta-this (ta-remove-item [%raw raw.old] pax)
|
|
|
|
(ta-update-collection col.old col.new pax)
|
|
|
|
::
|
|
|
|
::
|
|
|
|
?: &(?=(%error -.old) ?=(%error -.new))
|
|
|
|
ta-this
|
|
|
|
?: &(?=(%error -.old) ?=(%collection -.new))
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
?: &(?=(%error -.old) ?=(%raw -.new))
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
?: &(?=(%error -.old) ?=(%both -.new))
|
|
|
|
(ta-insert-item new pax)
|
|
|
|
?: ?=(%error -.new)
|
|
|
|
(ta-hall-lin pax 'error')
|
|
|
|
::
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
++ ta-update-raw-item
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-update-raw-item
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [old=raw-item new=raw-item pax=path]
|
|
|
|
^+ ta-this
|
|
|
|
?: =(old new)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
=? ta-this !=(data.old data.new)
|
|
|
|
=/ parent-path (scag (dec (lent pax)) pax)
|
|
|
|
%^ ta-hall-json
|
|
|
|
parent-path
|
|
|
|
'edited item'
|
|
|
|
(item-notify pax new now.bol byk.bol)
|
|
|
|
::
|
|
|
|
=? ta-this
|
|
|
|
?& =('.y' (fall (~(get by meta.new) %comments) '.n'))
|
|
|
|
=('.n' (fall (~(get by meta.old) %comments) '.n'))
|
|
|
|
==
|
2018-11-20 01:37:00 +03:00
|
|
|
=/ owner=(unit @ta) (~(get by meta.new) %owner)
|
|
|
|
=/ owner-p=@p
|
|
|
|
?~ owner our.bol
|
|
|
|
(fall (rush u.owner ;~(pfix sig fed:ag)) our.bol)
|
|
|
|
(ta-generate-comments pax owner-p)
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
=? ta-this
|
|
|
|
?& =('.n' (fall (~(get by meta.new) %comments) '.n'))
|
|
|
|
=('.y' (fall (~(get by meta.old) %comments) '.n'))
|
|
|
|
==
|
|
|
|
:: delete comments
|
|
|
|
(ta-remove (weld pax /collections-config))
|
|
|
|
::
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
++ ta-update-collection
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-update-collection
|
2018-11-07 09:46:39 +03:00
|
|
|
|= $: old=collection
|
|
|
|
new=collection
|
|
|
|
pax=path
|
|
|
|
==
|
|
|
|
^+ ta-this
|
|
|
|
::
|
|
|
|
=? ta-this !=(meta.old meta.new)
|
|
|
|
=/ parent-path (scag (dec (lent pax)) pax)
|
|
|
|
%^ ta-hall-json parent-path 'edited collection'
|
|
|
|
(collection-notify pax meta.new)
|
|
|
|
::
|
|
|
|
?: =(data.old data.new)
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
:: new values of all changed items
|
|
|
|
=/ upd-new (~(dif in (~(int by data.old) data.new)) data.old)
|
|
|
|
:: old values of all changed items
|
|
|
|
=/ upd-old (~(dif in (~(int by data.new) data.old)) data.new)
|
|
|
|
:: all totally new entries
|
|
|
|
=/ ins-new (~(dif by data.new) data.old)
|
|
|
|
:: all deleted entries
|
|
|
|
=/ del-old (~(dif by data.old) data.new)
|
|
|
|
::
|
|
|
|
=/ upd-new=(list [nom=knot =item]) ~(tap by upd-new)
|
|
|
|
=/ upd-old=(list [nom=knot =item]) ~(tap by upd-old)
|
|
|
|
=/ ins-new=(list [nom=knot =item]) ~(tap by ins-new)
|
|
|
|
=/ del-old=(list [nom=knot =item]) ~(tap by del-old)
|
|
|
|
::
|
|
|
|
=/ lam |=([[a=knot item] out=(list path)] [(weld pax [a ~]) out])
|
|
|
|
::
|
|
|
|
=. ta-this |-
|
|
|
|
?~ upd-new
|
|
|
|
ta-this
|
|
|
|
?< ?=(~ upd-old)
|
|
|
|
=* new-item i.upd-new
|
|
|
|
=* old-item i.upd-old
|
|
|
|
=/ new-pax (weld pax [nom.new-item ~])
|
|
|
|
=. ta-this (ta-update-item item.old-item item.new-item new-pax)
|
|
|
|
::
|
|
|
|
%= $
|
|
|
|
upd-new t.upd-new
|
|
|
|
upd-old t.upd-old
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=. ta-this |-
|
|
|
|
?~ ins-new
|
|
|
|
ta-this
|
|
|
|
=* new-item i.ins-new
|
|
|
|
=/ new-pax (weld pax [nom.new-item ~])
|
|
|
|
=. ta-this (ta-insert-item +.new-item (weld pax [-.new-item ~]))
|
|
|
|
$(ins-new t.ins-new)
|
|
|
|
::
|
|
|
|
=. ta-this |-
|
|
|
|
?~ del-old
|
|
|
|
ta-this
|
|
|
|
=* old-item i.del-old
|
|
|
|
=/ old-pax (weld pax [nom.old-item ~])
|
|
|
|
=. ta-this (ta-remove-item +.old-item (weld pax [-.old-item ~]))
|
|
|
|
$(del-old t.del-old)
|
|
|
|
::
|
|
|
|
ta-this
|
|
|
|
::
|
|
|
|
++ ta-generate-comments
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-generate-comments
|
2018-11-20 01:37:00 +03:00
|
|
|
|= [pax=path owner=ship]
|
2018-11-07 09:46:39 +03:00
|
|
|
^+ ta-this
|
|
|
|
=/ sup=path [%collections-config (flop pax)]
|
|
|
|
=/ bek byk.bol(r [%da now.bol])
|
|
|
|
=/ pat (en-beam:format [bek sup])
|
|
|
|
=/ dat=@da (slav %da (snag 0 (flop pax)))
|
|
|
|
=/ cay=config
|
|
|
|
:* [bek sup]
|
|
|
|
'comments'
|
|
|
|
'comments'
|
2018-11-20 01:37:00 +03:00
|
|
|
owner
|
2018-11-07 09:46:39 +03:00
|
|
|
dat
|
|
|
|
dat
|
|
|
|
%comments
|
|
|
|
|
|
|
|
|
~
|
|
|
|
|
|
|
|
|
==
|
|
|
|
(ta-write (flop sup) %collections-config !>(cay))
|
|
|
|
::
|
|
|
|
:: writing files
|
|
|
|
::
|
|
|
|
++ ta-write
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-write
|
2018-11-07 09:46:39 +03:00
|
|
|
=, space:userlib
|
|
|
|
|= [pax=path cay=cage]
|
|
|
|
^+ ta-this
|
|
|
|
=/ bek byk.bol(r [%da now.bol])
|
|
|
|
=. pax (en-beam:format bek (flop pax))
|
|
|
|
%+ ta-emit ost.bol
|
2018-12-13 10:59:53 +03:00
|
|
|
[%info (weld /ta-write pax) (foal pax cay)]
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
++ ta-remove
|
|
|
|
=, space:userlib
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-remove
|
2018-11-07 09:46:39 +03:00
|
|
|
|= pax=path
|
|
|
|
=/ bek byk.bol(r [%da now.bol])
|
|
|
|
=. pax (en-beam:format bek (flop pax))
|
|
|
|
^+ ta-this
|
|
|
|
%+ ta-emit ost.bol
|
2018-12-13 10:59:53 +03:00
|
|
|
[%info (weld /ta-remove pax) (fray pax)]
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
:: permissions
|
|
|
|
::
|
|
|
|
++ ta-set-permissions
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-set-permissions
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path r=rule:clay w=rule:clay]
|
|
|
|
^+ ta-this
|
|
|
|
%+ ta-emit ost.bol
|
2018-12-13 20:56:56 +03:00
|
|
|
[%perm (weld /perms pax) q.byk.bol pax [%rw `r `w]]
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
++ ta-flush-permissions
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-flush-permissions
|
2018-11-07 09:46:39 +03:00
|
|
|
|= pax=path
|
|
|
|
^+ ta-this
|
|
|
|
%+ ta-emit ost.bol
|
2018-12-13 20:56:56 +03:00
|
|
|
[%perm (weld /perms pax) q.byk.bol pax [%rw ~ ~]]
|
2018-11-07 09:46:39 +03:00
|
|
|
::
|
|
|
|
:: hall
|
|
|
|
::
|
|
|
|
++ ta-hall-action
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-hall-action
|
2018-11-07 09:46:39 +03:00
|
|
|
|= act=action:hall
|
|
|
|
^+ ta-this
|
|
|
|
%+ ta-emit ost.bol
|
|
|
|
[%poke /col-hall-action [our.bol %hall] %hall-action act]
|
|
|
|
::
|
|
|
|
++ ta-hall-actions
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-hall-actions
|
2018-11-07 09:46:39 +03:00
|
|
|
|= act=(list $?(~ action:hall))
|
|
|
|
^+ ta-this
|
|
|
|
?~ act ta-this
|
|
|
|
?~ i.act $(act t.act)
|
|
|
|
%= $
|
|
|
|
ta-this (ta-hall-action i.act)
|
|
|
|
act t.act
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-hall-create-circle
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-hall-create-circle
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path description=@t]
|
|
|
|
^+ ta-this
|
|
|
|
=/ circ=circle:hall (path-to-circle pax our.bol)
|
|
|
|
=/ parent=circle:hall
|
|
|
|
?: =(nom.circ %c)
|
|
|
|
[our.bol %inbox]
|
|
|
|
(path-to-circle (scag (dec (lent pax)) pax) our.bol)
|
|
|
|
%- ta-hall-actions
|
|
|
|
:~ [%create nom.circ description %journal]
|
|
|
|
[%source nom.parent & (sy `source:hall`[circ ~] ~)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-hall-lin
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-hall-lin
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path msg=cord]
|
|
|
|
^+ ta-this
|
|
|
|
=/ circ=circle:hall (path-to-circle pax our.bol)
|
|
|
|
%- ta-hall-action
|
|
|
|
[%phrase [circ ~ ~] [%lin | msg]~]
|
|
|
|
::
|
|
|
|
++ ta-hall-json
|
2018-11-02 06:26:15 +03:00
|
|
|
~/ %coll-ta-hall-json
|
2018-11-07 09:46:39 +03:00
|
|
|
|= [pax=path header=@t jon=json]
|
|
|
|
^+ ta-this
|
|
|
|
=/ circ=circle:hall (path-to-circle pax our.bol)
|
|
|
|
%- ta-hall-action
|
|
|
|
:+ %phrase [circ ~ ~]
|
|
|
|
[%fat [%text ~[header]] [%lin | (crip (en-json:html jon))]]~
|
|
|
|
::
|
|
|
|
--
|
2018-07-31 07:00:49 +03:00
|
|
|
--
|