mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-06 23:16:29 +03:00
publish: update state with limbo field
This commit is contained in:
parent
eef6e56dca
commit
f9e17e61a2
@ -52,14 +52,25 @@
|
|||||||
::
|
::
|
||||||
+$ state-two
|
+$ state-two
|
||||||
$: our-paths=(list path)
|
$: our-paths=(list path)
|
||||||
books=(map @tas notebook)
|
books=(map @tas notebook-2)
|
||||||
subs=(map [@p @tas] notebook)
|
subs=(map [@p @tas] notebook-2)
|
||||||
tile-num=@ud
|
tile-num=@ud
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
+$ state-three
|
||||||
|
$: our-paths=(list path)
|
||||||
|
books=(map [@p @tas] notebook)
|
||||||
|
tile-num=@ud
|
||||||
|
$= limbo
|
||||||
|
$: notes=(map [@p @tas @tas] note)
|
||||||
|
comments=(map [@p @tas @tas @da] comment)
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
$% [%1 state-two]
|
$% [%1 state-two]
|
||||||
[%2 state-two]
|
[%2 state-two]
|
||||||
|
[%3 state-three]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ metadata-delta
|
+$ metadata-delta
|
||||||
@ -75,7 +86,7 @@
|
|||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
=| versioned-state
|
=| [%3 state-three]
|
||||||
=* state -
|
=* state -
|
||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
@ -108,15 +119,18 @@
|
|||||||
++ on-load
|
++ on-load
|
||||||
|= old=vase
|
|= old=vase
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
=/ old-state=(each versioned-state tang)
|
=/ old-state=versioned-state !<(versioned-state old)
|
||||||
(mule |.(!<(versioned-state old)))
|
=| cards=(list card)
|
||||||
?: ?=(%& -.old-state)
|
|^
|
||||||
?- -.p.old-state
|
?- -.old-state
|
||||||
%1
|
%1
|
||||||
:_ this(state [%2 +.p.old-state])
|
%= $
|
||||||
|
-.old-state %2
|
||||||
|
::
|
||||||
|
cards
|
||||||
%- zing
|
%- zing
|
||||||
%+ turn ~(tap by books.p.old-state)
|
%+ turn ~(tap by books.old-state)
|
||||||
|= [name=@tas book=notebook]
|
|= [name=@tas book=notebook-2]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
=/ group-host=(unit @p)
|
=/ group-host=(unit @p)
|
||||||
?> ?=(^ writers.book)
|
?> ?=(^ writers.book)
|
||||||
@ -128,135 +142,55 @@
|
|||||||
::
|
::
|
||||||
(perm-hook-poke:main [%add-owned writers.book writers.book])
|
(perm-hook-poke:main [%add-owned writers.book writers.book])
|
||||||
==
|
==
|
||||||
|
==
|
||||||
::
|
::
|
||||||
%2
|
%2
|
||||||
[~ this(state p.old-state)]
|
%= $
|
||||||
==
|
old-state
|
||||||
=/ zero !<(state-zero old)
|
=/ new-books=(map [@p @tas] notebook)
|
||||||
|^
|
%- %~ uni by
|
||||||
=/ rav [%next %t [%da now.bol] /app/publish/notebooks]
|
%- ~(run by subs.old-state)
|
||||||
=/ tile-json
|
|= old-notebook=notebook-2
|
||||||
(frond:enjs:format %notifications (numb:enjs:format 0))
|
^- notebook-3
|
||||||
=/ init-cards=(list card)
|
(convert-notebook-2-3 old-notebook)
|
||||||
:~ [%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav]
|
^- (map [@p @tas] notebook)
|
||||||
:* %pass /permissions %agent [our.bol %permission-store] %watch
|
%- ~(rep by books.old-state)
|
||||||
/updates
|
|= [[key=@tas val=notebook-2] out=(map [@p @tas] notebook)]
|
||||||
==
|
^- (map [@p @tas] notebook)
|
||||||
(invite-poke:main [%create /publish])
|
%+ ~(put by out)
|
||||||
:* %pass /invites %agent [our.bol %invite-store] %watch
|
[our.bol key]
|
||||||
/invitatory/publish
|
(convert-notebook-2-3 val)
|
||||||
==
|
[%3 our-paths.old-state new-books tile-num.old-state [~ ~]]
|
||||||
[%give %fact [/publishtile]~ %json !>(tile-json)]
|
|
||||||
==
|
|
||||||
=+ ^- [kick-cards=(list card) old-subs=(jug @tas @p)] kick-subs
|
|
||||||
=/ inv-scry-pax
|
|
||||||
/(scot %p our.bol)/invite-store/(scot %da now.bol)/invitatory/publish/noun
|
|
||||||
=/ inv=(unit invitatory) .^((unit invitatory) %gx inv-scry-pax)
|
|
||||||
=| new-state=state-two
|
|
||||||
=? tile-num.new-state ?=(^ inv)
|
|
||||||
~(wyt by u.inv)
|
|
||||||
:_ this(state [%2 new-state])
|
|
||||||
;: weld
|
|
||||||
kill-builds
|
|
||||||
kick-cards
|
|
||||||
init-cards
|
|
||||||
(move-files old-subs)
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ kick-subs
|
%3
|
||||||
^- [(list card) (jug @tas @p)]
|
[cards this(state old-state)]
|
||||||
=+ ^- [paths=(list path) subs=(jug @tas @p)]
|
|
||||||
%+ roll ~(tap by sup.bol)
|
|
||||||
|= [[duct [who=@p pax=path]] paths=(list path) subs=(jug @tas @p)]
|
|
||||||
^- [(list path) (jug @tas @p)]
|
|
||||||
?. ?=([%collection @ ~] pax)
|
|
||||||
[paths subs]
|
|
||||||
=/ book-name i.t.pax
|
|
||||||
:- [pax paths]
|
|
||||||
(~(put ju subs) book-name who)
|
|
||||||
?~ paths
|
|
||||||
[~ subs]
|
|
||||||
[[%give %kick paths ~]~ subs]
|
|
||||||
::
|
|
||||||
++ kill-builds
|
|
||||||
^- (list card)
|
|
||||||
%- zing
|
|
||||||
%+ turn ~(tap by pubs.zero)
|
|
||||||
|= [col-name=@tas col-data=collection-zero]
|
|
||||||
^- (list card)
|
|
||||||
:- [%pass /collection/[col-name] %arvo %f %kill ~]
|
|
||||||
%- zing
|
|
||||||
%+ turn ~(tap by pos.col-data)
|
|
||||||
|= [pos-name=@tas *]
|
|
||||||
:~ [%pass /post/[col-name]/[pos-name] %arvo %f %kill ~]
|
|
||||||
[%pass /comments/[col-name]/[pos-name] %arvo %f %kill ~]
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ send-invites
|
++ convert-comment-2-3
|
||||||
|= [book=@tas subscribers=(set @p)]
|
|= prev=comment-2
|
||||||
^- (list card)
|
^- comment-3
|
||||||
%+ turn ~(tap in subscribers)
|
%= prev
|
||||||
|= who=@p
|
content [content.prev %.n]
|
||||||
^- card
|
|
||||||
=/ uid (sham %publish who book eny.bol)
|
|
||||||
=/ inv=invite
|
|
||||||
:* our.bol %publish /notebook/[book] who
|
|
||||||
(crip "invite for notebook {<our.bol>}/{(trip book)}")
|
|
||||||
==
|
==
|
||||||
=/ act=invite-action [%invite /publish uid inv]
|
|
||||||
[%pass /invite %agent [who %invite-hook] %poke %invite-action !>(act)]
|
|
||||||
::
|
::
|
||||||
++ move-files
|
++ convert-note-2-3
|
||||||
|= old-subs=(jug @tas @p)
|
|= prev=note-2
|
||||||
^- (list card)
|
^- note-3
|
||||||
=+ ^- [cards=(list card) sob=soba:clay]
|
%= prev
|
||||||
%+ roll .^((list path) %ct (weld our-beak:main /web/publish))
|
comments
|
||||||
|= [pax=path car=(list card) sob=soba:clay]
|
[(~(run by comments.prev) convert-comment-2-3) %.n]
|
||||||
^- [(list card) soba:clay]
|
==
|
||||||
?+ pax
|
::
|
||||||
[car sob]
|
++ convert-notebook-2-3
|
||||||
::
|
|= prev=notebook-2
|
||||||
[%web %publish @ %publish-info ~]
|
^- notebook-3
|
||||||
=/ book-name i.t.t.pax
|
%= prev
|
||||||
=/ old=old-info .^(old-info %cx (welp our-beak:main pax))
|
notes
|
||||||
=/ group-pax /~/(scot %p our.bol)/[book-name]
|
%- ~(run by notes.prev)
|
||||||
=/ book=notebook-info
|
|= =note-2
|
||||||
[title.old '' =(%open comments.old) / /]
|
(convert-note-2-3 note-2)
|
||||||
=+ ^- [grp-car=(list card) write-pax=path read-pax=path]
|
|
||||||
(make-groups:main book-name [group-pax ~ %.n %.n] title.old '')
|
|
||||||
=. writers.book write-pax
|
|
||||||
=. subscribers.book read-pax
|
|
||||||
=/ inv-car (send-invites book-name (~(get ju old-subs) book-name))
|
|
||||||
:- :(weld car grp-car inv-car)
|
|
||||||
^- soba:clay
|
|
||||||
:+ [pax %del ~]
|
|
||||||
:- /app/publish/notebooks/[book-name]/publish-info
|
|
||||||
[%ins %publish-info !>(book)]
|
|
||||||
sob
|
|
||||||
::
|
|
||||||
[%web %publish @ @ %udon ~]
|
|
||||||
=/ book i.t.t.pax
|
|
||||||
=/ note i.t.t.t.pax
|
|
||||||
:- car
|
|
||||||
:+ [pax %del ~]
|
|
||||||
:- /app/publish/notebooks/[book]/[note]/udon
|
|
||||||
[%ins %udon !>(.^(@t %cx (welp our-beak:main pax)))]
|
|
||||||
sob
|
|
||||||
::
|
|
||||||
[%web %publish @ @ @ %publish-comment ~]
|
|
||||||
=/ book i.t.t.pax
|
|
||||||
=/ note i.t.t.t.pax
|
|
||||||
=/ comm i.t.t.t.t.pax
|
|
||||||
=/ old=old-comment .^(old-comment %cx (welp our-beak:main pax))
|
|
||||||
=/ new=comment [creator.old date-created.old content.old]
|
|
||||||
:- car
|
|
||||||
|
|
||||||
:+ [pax %del ~]
|
|
||||||
:- /app/publish/notebooks/[book]/[note]/[comm]/publish-comment
|
|
||||||
[%ins %publish-comment !>(new)]
|
|
||||||
sob
|
|
||||||
==
|
==
|
||||||
[[%pass /move-files %arvo %c %info q.byk.bol %& sob] cards]
|
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
@ -324,7 +258,7 @@
|
|||||||
=/ who=@p (slav %p i.t.wir)
|
=/ who=@p (slav %p i.t.wir)
|
||||||
=/ book=@tas i.t.t.wir
|
=/ book=@tas i.t.t.wir
|
||||||
=/ del [%del-book who book]
|
=/ del [%del-book who book]
|
||||||
:_ this(subs (~(del by subs) who book))
|
:_ this(books (~(del by books) who book))
|
||||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
||||||
:: Resubscribe to any subscription we get kicked from. The case of actually
|
:: Resubscribe to any subscription we get kicked from. The case of actually
|
||||||
:: getting banned from a notebook is handled by %watch-ack
|
:: getting banned from a notebook is handled by %watch-ack
|
||||||
@ -470,7 +404,7 @@
|
|||||||
?> ?=([%app %publish %notebooks @ @ %udon ~] pax)
|
?> ?=([%app %publish %notebooks @ @ %udon ~] pax)
|
||||||
=/ book-name i.t.t.t.pax
|
=/ book-name i.t.t.t.pax
|
||||||
=/ note-name i.t.t.t.t.pax
|
=/ note-name i.t.t.t.t.pax
|
||||||
=/ book (~(get by books) book-name)
|
=/ book (~(get by books) our.bol book-name)
|
||||||
?~ book
|
?~ book
|
||||||
[~ state]
|
[~ state]
|
||||||
=/ old-note (~(get by notes.u.book) note-name)
|
=/ old-note (~(get by notes.u.book) note-name)
|
||||||
@ -548,7 +482,7 @@
|
|||||||
[%app %publish %notebooks @ @ %udon ~]
|
[%app %publish %notebooks @ @ %udon ~]
|
||||||
=/ book-name i.t.t.t.pax
|
=/ book-name i.t.t.t.pax
|
||||||
=/ note-name i.t.t.t.t.pax
|
=/ note-name i.t.t.t.t.pax
|
||||||
=/ book (~(get by books.sty) book-name)
|
=/ book (~(get by books.sty) our.bol book-name)
|
||||||
?~ book
|
?~ book
|
||||||
[cad sty]
|
[cad sty]
|
||||||
=. notes.u.book (~(del by notes.u.book) note-name)
|
=. notes.u.book (~(del by notes.u.book) note-name)
|
||||||
@ -751,10 +685,12 @@
|
|||||||
[~ state]
|
[~ state]
|
||||||
=/ book=(unit @tas)
|
=/ book=(unit @tas)
|
||||||
%+ roll ~(tap by books)
|
%+ roll ~(tap by books)
|
||||||
|= [[nom=@tas book=notebook] out=(unit @tas)]
|
|= [[[who=@p nom=@tas] book=notebook] out=(unit @tas)]
|
||||||
?: =(path.upd subscribers.book)
|
?. =(who our.bol)
|
||||||
`nom
|
|
||||||
out
|
out
|
||||||
|
?. =(path.upd subscribers.book)
|
||||||
|
out
|
||||||
|
`nom
|
||||||
?~ book
|
?~ book
|
||||||
[~ state]
|
[~ state]
|
||||||
:_ state
|
:_ state
|
||||||
@ -822,7 +758,7 @@
|
|||||||
=/ book-name i.t.pax
|
=/ book-name i.t.pax
|
||||||
?. (allowed src.bol %read book-name)
|
?. (allowed src.bol %read book-name)
|
||||||
~|("not permitted" !!)
|
~|("not permitted" !!)
|
||||||
=/ book (~(got by books) book-name)
|
=/ book (~(got by books) our.bol book-name)
|
||||||
=/ delta=notebook-delta
|
=/ delta=notebook-delta
|
||||||
[%add-book our.bol book-name book]
|
[%add-book our.bol book-name book]
|
||||||
:_ state
|
:_ state
|
||||||
@ -834,7 +770,7 @@
|
|||||||
|= [who=@p mod=?(%read %write) book=@tas]
|
|= [who=@p mod=?(%read %write) book=@tas]
|
||||||
^- ?
|
^- ?
|
||||||
=/ scry-bek /(scot %p our.bol)/permission-store/(scot %da now.bol)
|
=/ scry-bek /(scot %p our.bol)/permission-store/(scot %da now.bol)
|
||||||
=/ book=notebook (~(got by books) book)
|
=/ book=notebook (~(got by books) our.bol book)
|
||||||
=/ scry-pax
|
=/ scry-pax
|
||||||
?: =(%read mod)
|
?: =(%read mod)
|
||||||
subscribers.book
|
subscribers.book
|
||||||
@ -1013,7 +949,7 @@
|
|||||||
%new-book
|
%new-book
|
||||||
?. (team:title our.bol src.bol)
|
?. (team:title our.bol src.bol)
|
||||||
~|("action not permitted" !!)
|
~|("action not permitted" !!)
|
||||||
?: (~(has by books) book.act)
|
?: (~(has by books) our.bol book.act)
|
||||||
~|("notebook already exists: {<book.act>}" !!)
|
~|("notebook already exists: {<book.act>}" !!)
|
||||||
=+ ^- [cards=(list card) write-pax=path read-pax=path]
|
=+ ^- [cards=(list card) write-pax=path read-pax=path]
|
||||||
(make-groups book.act group.act title.act about.act)
|
(make-groups book.act group.act title.act about.act)
|
||||||
@ -1232,7 +1168,7 @@
|
|||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
=/ wir=wire /subscribe/(scot %p who.act)/[book.act]
|
=/ wir=wire /subscribe/(scot %p who.act)/[book.act]
|
||||||
=/ del=primary-delta [%del-book who.act book.act]
|
=/ del=primary-delta [%del-book who.act book.act]
|
||||||
:_ state(subs (~(del by subs) who.act book.act))
|
:_ state(books (~(del by books) who.act book.act))
|
||||||
:~ `card`[%pass wir %agent [who.act %publish] %leave ~]
|
:~ `card`[%pass wir %agent [who.act %publish] %leave ~]
|
||||||
`card`[%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
`card`[%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||||
==
|
==
|
||||||
@ -1240,9 +1176,7 @@
|
|||||||
%read
|
%read
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook)
|
||||||
?: =(our.bol who.act)
|
(~(get by books) who.act book.act)
|
||||||
(~(get by books) book.act)
|
|
||||||
(~(get by subs) who.act book.act)
|
|
||||||
?~ book
|
?~ book
|
||||||
~|("nonexistent notebook: {<book.act>}" !!)
|
~|("nonexistent notebook: {<book.act>}" !!)
|
||||||
=/ not=(unit note) (~(get by notes.u.book) note.act)
|
=/ not=(unit note) (~(get by notes.u.book) note.act)
|
||||||
@ -1252,10 +1186,7 @@
|
|||||||
(dec tile-num)
|
(dec tile-num)
|
||||||
=. read.u.not %.y
|
=. read.u.not %.y
|
||||||
=. notes.u.book (~(put by notes.u.book) note.act u.not)
|
=. notes.u.book (~(put by notes.u.book) note.act u.not)
|
||||||
=? books =(our.bol who.act)
|
=. books (~(put by books) [who.act book.act] u.book)
|
||||||
(~(put by books) book.act u.book)
|
|
||||||
=? subs !=(our.bol who.act)
|
|
||||||
(~(put by subs) [who.act book.act] u.book)
|
|
||||||
=/ jon=json
|
=/ jon=json
|
||||||
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||||
:_ state
|
:_ state
|
||||||
@ -1267,9 +1198,7 @@
|
|||||||
++ get-notebook
|
++ get-notebook
|
||||||
|= [host=@p book-name=@tas sty=_state]
|
|= [host=@p book-name=@tas sty=_state]
|
||||||
^- (unit notebook)
|
^- (unit notebook)
|
||||||
?: =(our.bol host)
|
(~(get by books.sty) host book-name)
|
||||||
(~(get by books.sty) book-name)
|
|
||||||
(~(get by subs.sty) host book-name)
|
|
||||||
::
|
::
|
||||||
++ get-unread
|
++ get-unread
|
||||||
|= book=notebook
|
|= book=notebook
|
||||||
@ -1283,14 +1212,13 @@
|
|||||||
++ emit-updates-and-state
|
++ emit-updates-and-state
|
||||||
|= [host=@p book-name=@tas book=notebook del=notebook-delta sty=_state]
|
|= [host=@p book-name=@tas book=notebook del=notebook-delta sty=_state]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
|
:_ sty(books (~(put by books.sty) [host book-name] book))
|
||||||
?: =(our.bol host)
|
?: =(our.bol host)
|
||||||
:_ sty(books (~(put by books.sty) book-name book))
|
|
||||||
:~ [%give %fact [/notebook/[book-name]]~ %publish-notebook-delta !>(del)]
|
:~ [%give %fact [/notebook/[book-name]]~ %publish-notebook-delta !>(del)]
|
||||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
[%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||||
==
|
==
|
||||||
=/ jon=json
|
=/ jon=json
|
||||||
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||||
:_ sty(subs (~(put by subs.sty) [host book-name] book))
|
|
||||||
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||||
==
|
==
|
||||||
@ -1489,20 +1417,19 @@
|
|||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook)
|
||||||
(get-notebook host.del book.del sty)
|
(get-notebook host.del book.del sty)
|
||||||
?~ book [~ sty]
|
?~ book [~ sty]
|
||||||
|
:_ sty(books (~(del by books.sty) host.del book.del))
|
||||||
?. =(our.bol host.del)
|
?. =(our.bol host.del)
|
||||||
=. tile-num
|
=. tile-num
|
||||||
%+ sub tile-num
|
%+ sub tile-num
|
||||||
(get-unread (~(got by subs) host.del book.del))
|
(get-unread (~(got by books) host.del book.del))
|
||||||
=/ jon=json
|
=/ jon=json
|
||||||
(frond:enjs:format %notifications (numb:enjs:format tile-num.sty))
|
(frond:enjs:format %notifications (numb:enjs:format tile-num.sty))
|
||||||
:_ sty(subs (~(del by subs.sty) host.del book.del))
|
|
||||||
%+ welp
|
%+ welp
|
||||||
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||||
==
|
==
|
||||||
?: (is-managed writers.u.book) ~
|
?: (is-managed writers.u.book) ~
|
||||||
[(metadata-hook-poke [%remove writers.u.book])]~
|
[(metadata-hook-poke [%remove writers.u.book])]~
|
||||||
:_ sty(books (~(del by books.sty) book.del))
|
|
||||||
%- zing
|
%- zing
|
||||||
:~ [%give %fact [/notebook/[book.del]]~ %publish-notebook-delta !>(del)]~
|
:~ [%give %fact [/notebook/[book.del]]~ %publish-notebook-delta !>(del)]~
|
||||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
||||||
@ -1551,10 +1478,7 @@
|
|||||||
|= [host=@p book-name=@tas]
|
|= [host=@p book-name=@tas]
|
||||||
^- (unit json)
|
^- (unit json)
|
||||||
=, enjs:format
|
=, enjs:format
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) host book-name)
|
||||||
?: =(our.bol host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
~
|
~
|
||||||
=/ notebook-json (notebook-full-json host book-name u.book)
|
=/ notebook-json (notebook-full-json host book-name u.book)
|
||||||
@ -1563,7 +1487,7 @@
|
|||||||
(~(uni by p.notebook-json) (notes-page notes.u.book 0 50))
|
(~(uni by p.notebook-json) (notes-page notes.u.book 0 50))
|
||||||
=. p.notebook-json
|
=. p.notebook-json
|
||||||
(~(put by p.notebook-json) %subscribers (get-subscribers-json book-name))
|
(~(put by p.notebook-json) %subscribers (get-subscribers-json book-name))
|
||||||
=/ notebooks-json (notebooks-map-json our.bol books subs)
|
=/ notebooks-json (notebooks-map-json our.bol books)
|
||||||
?> ?=(%o -.notebooks-json)
|
?> ?=(%o -.notebooks-json)
|
||||||
=/ host-books-json (~(got by p.notebooks-json) (scot %p host))
|
=/ host-books-json (~(got by p.notebooks-json) (scot %p host))
|
||||||
?> ?=(%o -.host-books-json)
|
?> ?=(%o -.host-books-json)
|
||||||
@ -1576,10 +1500,7 @@
|
|||||||
|= [host=@p book-name=@tas note-name=@tas]
|
|= [host=@p book-name=@tas note-name=@tas]
|
||||||
^- (unit json)
|
^- (unit json)
|
||||||
=, enjs:format
|
=, enjs:format
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) host book-name)
|
||||||
?: =(our.bol host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
~
|
~
|
||||||
=/ note=(unit note) (~(get by notes.u.book) note-name)
|
=/ note=(unit note) (~(get by notes.u.book) note-name)
|
||||||
@ -1589,7 +1510,7 @@
|
|||||||
?> ?=(%o -.notebook-json)
|
?> ?=(%o -.notebook-json)
|
||||||
=/ note-json (note-presentation-json u.book note-name u.note)
|
=/ note-json (note-presentation-json u.book note-name u.note)
|
||||||
=. p.notebook-json (~(uni by p.notebook-json) note-json)
|
=. p.notebook-json (~(uni by p.notebook-json) note-json)
|
||||||
=/ notebooks-json (notebooks-map-json our.bol books subs)
|
=/ notebooks-json (notebooks-map-json our.bol books)
|
||||||
?> ?=(%o -.notebooks-json)
|
?> ?=(%o -.notebooks-json)
|
||||||
=/ host-books-json (~(got by p.notebooks-json) (scot %p host))
|
=/ host-books-json (~(got by p.notebooks-json) (scot %p host))
|
||||||
?> ?=(%o -.host-books-json)
|
?> ?=(%o -.host-books-json)
|
||||||
@ -1633,7 +1554,7 @@
|
|||||||
[[[~ %json] [%'~publish' %notebooks ~]] ~]
|
[[[~ %json] [%'~publish' %notebooks ~]] ~]
|
||||||
%- json-response:gen
|
%- json-response:gen
|
||||||
%- json-to-octs
|
%- json-to-octs
|
||||||
(notebooks-map-json our.bol books subs)
|
(notebooks-map-json our.bol books)
|
||||||
::
|
::
|
||||||
:: notes pagination
|
:: notes pagination
|
||||||
[[[~ %json] [%'~publish' %notes @ @ @ @ ~]] ~]
|
[[[~ %json] [%'~publish' %notes @ @ @ @ ~]] ~]
|
||||||
@ -1641,10 +1562,7 @@
|
|||||||
?~ host
|
?~ host
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ book-name i.t.t.t.site.url
|
=/ book-name i.t.t.t.site.url
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||||
?: =(our.bol u.host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) u.host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ start (rush i.t.t.t.t.site.url dem)
|
=/ start (rush i.t.t.t.t.site.url dem)
|
||||||
@ -1664,10 +1582,7 @@
|
|||||||
?~ host
|
?~ host
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ book-name i.t.t.t.site.url
|
=/ book-name i.t.t.t.site.url
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||||
?: =(our.bol u.host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) u.host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ note-name i.t.t.t.t.site.url
|
=/ note-name i.t.t.t.t.site.url
|
||||||
@ -1691,10 +1606,7 @@
|
|||||||
?~ host
|
?~ host
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ book-name i.t.t.site.url
|
=/ book-name i.t.t.site.url
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||||
?: =(our.bol u.host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) u.host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ notebook-json (notebook-full-json u.host book-name u.book)
|
=/ notebook-json (notebook-full-json u.host book-name u.book)
|
||||||
@ -1713,10 +1625,7 @@
|
|||||||
?~ host
|
?~ host
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ book-name i.t.t.site.url
|
=/ book-name i.t.t.site.url
|
||||||
=/ book=(unit notebook)
|
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||||
?: =(our.bol u.host)
|
|
||||||
(~(get by books) book-name)
|
|
||||||
(~(get by subs) u.host book-name)
|
|
||||||
?~ book
|
?~ book
|
||||||
not-found:gen
|
not-found:gen
|
||||||
=/ note-name i.t.t.t.site.url
|
=/ note-name i.t.t.t.site.url
|
||||||
@ -1731,7 +1640,7 @@
|
|||||||
:: all notebooks, short form, wrapped in html
|
:: all notebooks, short form, wrapped in html
|
||||||
[[~ [%'~publish' ?(~ [%join *] [%new ~])]] ~]
|
[[~ [%'~publish' ?(~ [%join *] [%new ~])]] ~]
|
||||||
=, enjs:format
|
=, enjs:format
|
||||||
=/ jon=json (pairs notebooks+(notebooks-map-json our.bol books subs) ~)
|
=/ jon=json (pairs notebooks+(notebooks-map-json our.bol books) ~)
|
||||||
(manx-response:gen (index jon))
|
(manx-response:gen (index jon))
|
||||||
::
|
::
|
||||||
:: single notebook, with initial 50 notes in short form, wrapped in html
|
:: single notebook, with initial 50 notes in short form, wrapped in html
|
||||||
|
@ -60,11 +60,11 @@
|
|||||||
(notebook-short-json book)
|
(notebook-short-json book)
|
||||||
::
|
::
|
||||||
++ notebooks-map-json
|
++ notebooks-map-json
|
||||||
|= [our=@p books=(map @tas notebook) subs=(map [@p @tas] notebook)]
|
|= [our=@p books=(map [@p @tas] notebook)]
|
||||||
^- json
|
^- json
|
||||||
=, enjs:format
|
=, enjs:format
|
||||||
=/ subs-notebooks-map=json
|
=/ notebooks-map=json
|
||||||
%- ~(rep by subs)
|
%- ~(rep by books)
|
||||||
|= [[[host=@p book-name=@tas] book=notebook] out=json]
|
|= [[[host=@p book-name=@tas] book=notebook] out=json]
|
||||||
^- json
|
^- json
|
||||||
=/ host-ta (scot %p host)
|
=/ host-ta (scot %p host)
|
||||||
@ -79,22 +79,9 @@
|
|||||||
=. p.u.books (~(put by p.u.books) book-name (notebook-short-json book))
|
=. p.u.books (~(put by p.u.books) book-name (notebook-short-json book))
|
||||||
:- %o
|
:- %o
|
||||||
(~(put by p.out) host-ta u.books)
|
(~(put by p.out) host-ta u.books)
|
||||||
=? subs-notebooks-map ?=(~ subs-notebooks-map)
|
=? notebooks-map ?=(~ notebooks-map)
|
||||||
[%o ~]
|
[%o ~]
|
||||||
=/ our-notebooks-map=json
|
notebooks-map
|
||||||
%- ~(rep by books)
|
|
||||||
|= [[book-name=@tas book=notebook] out=json]
|
|
||||||
^- json
|
|
||||||
?~ out
|
|
||||||
(frond book-name (notebook-short-json book))
|
|
||||||
?> ?=(%o -.out)
|
|
||||||
:- %o
|
|
||||||
(~(put by p.out) book-name (notebook-short-json book))
|
|
||||||
?~ our-notebooks-map
|
|
||||||
subs-notebooks-map
|
|
||||||
?> ?=(%o -.subs-notebooks-map)
|
|
||||||
:- %o
|
|
||||||
(~(put by p.subs-notebooks-map) (scot %p our) our-notebooks-map)
|
|
||||||
::
|
::
|
||||||
++ notebook-short-json
|
++ notebook-short-json
|
||||||
|= book=notebook
|
|= book=notebook
|
||||||
@ -170,6 +157,7 @@
|
|||||||
num-comments+(numb ~(wyt by comments.note))
|
num-comments+(numb ~(wyt by comments.note))
|
||||||
comments+(comments-page comments.note 0 50)
|
comments+(comments-page comments.note 0 50)
|
||||||
read+b+read.note
|
read+b+read.note
|
||||||
|
pending+b+pending.note
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ notes-by-date
|
++ notes-by-date
|
||||||
@ -197,6 +185,7 @@
|
|||||||
num-comments+(numb ~(wyt by comments.note))
|
num-comments+(numb ~(wyt by comments.note))
|
||||||
read+b+read.note
|
read+b+read.note
|
||||||
snippet+s+snippet.note
|
snippet+s+snippet.note
|
||||||
|
pending+b+pending.note
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ notes-page
|
++ notes-page
|
||||||
@ -246,5 +235,6 @@
|
|||||||
:~ author+s+(scot %p author.com)
|
:~ author+s+(scot %p author.com)
|
||||||
date-created+(time date-created.com)
|
date-created+(time date-created.com)
|
||||||
content+s+content.com
|
content+s+content.com
|
||||||
|
pending+b+pending.com
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
%+ cook
|
%+ cook
|
||||||
|= [author=@ @ @ date-created=@da @ content=@t]
|
|= [author=@ @ @ date-created=@da @ content=@t]
|
||||||
^- comment
|
^- comment
|
||||||
[author date-created content]
|
[author date-created content %.n]
|
||||||
old-parser
|
old-parser
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
|
@ -27,13 +27,24 @@
|
|||||||
[%read who=@p book=@tas note=@tas]
|
[%read who=@p book=@tas note=@tas]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ comment
|
+$ comment comment-3
|
||||||
|
::
|
||||||
|
+$ comment-2
|
||||||
$: author=@p
|
$: author=@p
|
||||||
date-created=@da
|
date-created=@da
|
||||||
content=@t
|
content=@t
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ note
|
+$ comment-3
|
||||||
|
$: author=@p
|
||||||
|
date-created=@da
|
||||||
|
content=@t
|
||||||
|
pending=?
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ note note-3
|
||||||
|
::
|
||||||
|
+$ note-2
|
||||||
$: author=@p
|
$: author=@p
|
||||||
title=@t
|
title=@t
|
||||||
filename=@tas
|
filename=@tas
|
||||||
@ -42,11 +53,37 @@
|
|||||||
read=?
|
read=?
|
||||||
file=@t
|
file=@t
|
||||||
snippet=@t
|
snippet=@t
|
||||||
:: build=(each manx tang)
|
comments=(map @da comment-2)
|
||||||
comments=(map @da comment)
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ notebook
|
+$ note-3
|
||||||
|
$: author=@p
|
||||||
|
title=@t
|
||||||
|
filename=@tas
|
||||||
|
date-created=@da
|
||||||
|
last-edit=@da
|
||||||
|
read=?
|
||||||
|
file=@t
|
||||||
|
snippet=@t
|
||||||
|
comments=(map @da comment)
|
||||||
|
pending=?
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ notebook notebook-3
|
||||||
|
::
|
||||||
|
+$ notebook-2
|
||||||
|
$: title=@t
|
||||||
|
description=@t
|
||||||
|
comments=?
|
||||||
|
writers=path
|
||||||
|
subscribers=path
|
||||||
|
date-created=@da
|
||||||
|
notes=(map @tas note-2)
|
||||||
|
order=(list @tas)
|
||||||
|
unread=(set @tas)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ notebook-3
|
||||||
$: title=@t
|
$: title=@t
|
||||||
description=@t
|
description=@t
|
||||||
comments=?
|
comments=?
|
||||||
|
Loading…
Reference in New Issue
Block a user