mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
add sur/collections
This commit is contained in:
parent
5c0213bff8
commit
c1673fc506
@ -1,6 +1,6 @@
|
||||
:: /app/collection/hoon
|
||||
::
|
||||
/- hall
|
||||
/- hall, *collections
|
||||
/+ hall ::, rekey
|
||||
:: /= cols
|
||||
:: /: /===/web/collections
|
||||
@ -43,42 +43,6 @@
|
||||
::
|
||||
--
|
||||
=> |%
|
||||
++ state ::
|
||||
$: cols/(map time collection) :: collections by name
|
||||
== ::
|
||||
++ collection ::
|
||||
$: conf/config :: configuration
|
||||
tops/(map @da topic) :: parent-level content
|
||||
== ::
|
||||
++ topic ::
|
||||
$: tit/cord :: title
|
||||
comment ::
|
||||
== ::
|
||||
++ comment ::
|
||||
$: who/ship :: author
|
||||
wed/@da :: editted
|
||||
wat/wain :: content
|
||||
== ::
|
||||
++ config ::
|
||||
$: desc/cord :: description
|
||||
publ/? :: public or private
|
||||
visi/? :: visible or hidden
|
||||
mems/(set ship) :: ships on list
|
||||
== ::
|
||||
++ action ::
|
||||
$% $: $create :: create a collection
|
||||
wat/kind :: collection kind
|
||||
des/cord :: name
|
||||
pub/? :: public or private
|
||||
vis/? :: visible or hidden
|
||||
ses/(set ship) :: black/whitelist
|
||||
== ::
|
||||
::TODO probably want to specify @da here too.
|
||||
{$submit col/time tit/cord wat/wain} :: submit a post/note
|
||||
{$comment col/time top/@da com/@da wat/wain} :: submit a comment
|
||||
{$delete col/time} :: delete a collection
|
||||
== ::
|
||||
++ kind ?($blog $fora $note) ::
|
||||
++ move (pair bone card) :: all actions
|
||||
++ poke ::
|
||||
$% {$hall-action action:hall} ::
|
||||
@ -96,7 +60,7 @@
|
||||
::
|
||||
=, wired
|
||||
=, space:userlib
|
||||
|_ {bol/bowl:gall state}
|
||||
|_ {bol/bowl:gall cols/collections}
|
||||
::
|
||||
++ prep ::< prepare state
|
||||
::> adapts state.
|
||||
@ -128,7 +92,7 @@
|
||||
:: /web/collections/[col]/[top] for each topic as they get created.
|
||||
::
|
||||
++ ignore-action
|
||||
|= act/action ^- ?
|
||||
|= act=action:api ^- ?
|
||||
?- -.act
|
||||
?($create $delete)
|
||||
?: (team:title our.bol src.bol) |
|
||||
@ -143,7 +107,7 @@
|
||||
==
|
||||
::
|
||||
++ poke-collections-action
|
||||
|= act/action
|
||||
|= act=action:api
|
||||
^- (quip move _+>)
|
||||
?: (ignore-action act)
|
||||
[~ +>]
|
||||
@ -176,7 +140,7 @@
|
||||
:: %performing-actions
|
||||
::
|
||||
++ ta-create
|
||||
|= {wat/kind cof/config}
|
||||
|= {wat/kind:api cof/config}
|
||||
^+ +>
|
||||
::XX unhandled kind
|
||||
(ta-change-config now.bol cof %poke)
|
||||
@ -222,7 +186,7 @@
|
||||
=+ ole=(~(get by cols) col)
|
||||
:: if we don't have it yet, add to state and hall.
|
||||
?~ ole
|
||||
=. cols (~(put by cols) col new ~)
|
||||
=. cols (~(put by cols) col new ~ ~)
|
||||
(ta-hall-create col new)
|
||||
=/ old conf.u.ole
|
||||
:: make sure publ stays unchanged.
|
||||
@ -258,7 +222,7 @@
|
||||
:: store in state
|
||||
~| ~(key by cols)
|
||||
=/ cos (~(got by cols) col)
|
||||
=. tops.cos (~(put by tops.cos) wen top)
|
||||
=. tops.cos (~(put by tops.cos) wen top ~ ~)
|
||||
=. cols (~(put by cols) col cos)
|
||||
::
|
||||
=/ new =(~ old)
|
||||
|
@ -1,22 +1,7 @@
|
||||
:: /action/collections/mar
|
||||
::
|
||||
|%
|
||||
:: XX sur/collections
|
||||
++ kind ?($blog $fora $note) ::
|
||||
++ action
|
||||
$% $: $create :: create a collection
|
||||
wat/kind :: collection kind
|
||||
des/cord :: name
|
||||
pub/? :: public or private
|
||||
vis/? :: visible or hidden
|
||||
ses/(set ship) :: black/whitelist
|
||||
== ::
|
||||
{$submit col/time tit/cord wat/wain} :: submit a post/note
|
||||
{$comment col/time top/@da com/@da wat/wain} :: submit a comment
|
||||
{$delete col/time} :: delete a collection
|
||||
== ::
|
||||
--
|
||||
::
|
||||
/- collections
|
||||
=, api:collections
|
||||
|_ act=action
|
||||
::
|
||||
++ grow
|
||||
|
@ -1,11 +1,7 @@
|
||||
:: /mar/collections/comment/hoon
|
||||
::
|
||||
|_ $= com
|
||||
$: who/ship :: author
|
||||
wed/@da :: editted
|
||||
wat/wain :: content
|
||||
== ::
|
||||
::
|
||||
/- *collections
|
||||
|_ com=comment
|
||||
++ grow
|
||||
|%
|
||||
++ mime
|
||||
|
@ -1,11 +1,8 @@
|
||||
:: /mar/collections/config/hoon
|
||||
::
|
||||
|_ $= con
|
||||
$: desc/cord :: description
|
||||
publ/? :: public or private
|
||||
visi/? :: visioverable
|
||||
mems/(set ship) :: ships on list
|
||||
== ::
|
||||
/- *collections
|
||||
|_ con=config
|
||||
::
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
|
@ -1,11 +1,7 @@
|
||||
:: /mar/collections/topic/hoon
|
||||
::
|
||||
|_ $= top
|
||||
$: tit/cord :: title
|
||||
who/ship :: author
|
||||
wed/@da :: editted
|
||||
wat/wain :: content
|
||||
== ::
|
||||
/- *collections
|
||||
|_ top=topic
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
|
43
sur/collections.hoon
Normal file
43
sur/collections.hoon
Normal file
@ -0,0 +1,43 @@
|
||||
=< |=(a=* %.(a (map time collection))) :: collections by name
|
||||
|% ::
|
||||
++ collection ::
|
||||
$: conf/config :: configuration
|
||||
tops/(map @da topicful) ::
|
||||
$~ :: /. compatibility
|
||||
== ::
|
||||
:: ++ topicful {topic comt/(map @da comment)} ::
|
||||
++ topicful {topic comt/(map @da comment) $~} ::
|
||||
:: ::
|
||||
++ config ::
|
||||
$: desc/cord :: description
|
||||
publ/? :: public or private
|
||||
visi/? :: visible or hidden
|
||||
mems/(set ship) :: ships on list
|
||||
== ::
|
||||
++ topic ::
|
||||
$: tit/cord :: title
|
||||
comment ::
|
||||
== ::
|
||||
++ comment ::
|
||||
$: who/ship :: author
|
||||
wed/@da :: editted
|
||||
wat/wain :: content
|
||||
== ::
|
||||
::
|
||||
++ api
|
||||
|%
|
||||
++ kind ?($blog $fora $note) ::
|
||||
++ action ::
|
||||
$% $: $create :: create a collection
|
||||
wat/kind :: collection kind
|
||||
des/cord :: name
|
||||
pub/? :: public or private
|
||||
vis/? :: visible or hidden
|
||||
ses/(set ship) :: black/whitelist
|
||||
== ::
|
||||
{$submit col/time tit/cord wat/wain} :: submit a post/note
|
||||
{$comment col/time top/@da com/@da wat/wain} :: submit a comment
|
||||
{$delete col/time} :: delete a collection
|
||||
== ::
|
||||
--
|
||||
--
|
Loading…
Reference in New Issue
Block a user