diff --git a/app/collections.hoon b/app/collections.hoon index 65ccd0f8ec..6b6c166b75 100644 --- a/app/collections.hoon +++ b/app/collections.hoon @@ -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) diff --git a/mar/collections/action.hoon b/mar/collections/action.hoon index b370d79ca5..4da5d347d2 100644 --- a/mar/collections/action.hoon +++ b/mar/collections/action.hoon @@ -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 diff --git a/mar/collections/comment.hoon b/mar/collections/comment.hoon index 5941e98f20..24e89efc3b 100644 --- a/mar/collections/comment.hoon +++ b/mar/collections/comment.hoon @@ -1,11 +1,7 @@ :: /mar/collections/comment/hoon :: -|_ $= com - $: who/ship :: author - wed/@da :: editted - wat/wain :: content - == :: -:: +/- *collections +|_ com=comment ++ grow |% ++ mime diff --git a/mar/collections/config.hoon b/mar/collections/config.hoon index 9519e50199..e5d2bdec6c 100644 --- a/mar/collections/config.hoon +++ b/mar/collections/config.hoon @@ -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 |% diff --git a/mar/collections/topic.hoon b/mar/collections/topic.hoon index 9b9c9a1db2..3c48895838 100644 --- a/mar/collections/topic.hoon +++ b/mar/collections/topic.hoon @@ -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 |% diff --git a/sur/collections.hoon b/sur/collections.hoon new file mode 100644 index 0000000000..f775cabd11 --- /dev/null +++ b/sur/collections.hoon @@ -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 + == :: + -- +--