diff options
Diffstat (limited to 'desk/lib/wall.hoon')
-rw-r--r-- | desk/lib/wall.hoon | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/desk/lib/wall.hoon b/desk/lib/wall.hoon new file mode 100644 index 0000000..1ecb879 --- /dev/null +++ b/desk/lib/wall.hoon @@ -0,0 +1,156 @@ +/- b=boke +/+ const=constants +|_ him=@p + +++ tags +|= in=(list @t) ^- (list @t) + %+ skim in tag-filter +++ tag-map +|= tt=tags-table:b ^- tags-table:b + =/ tag-list ~(tap by tt) + %- malt + %+ skim tag-list |= [t=@t *] (tag-filter t) + +++ post-filter +|= tags=(set @t) ^- ? + ?^ (~(int in public-tags) tags) .y + =/ l ~(tap in tags) + |- + ?~ l .y + ?. (tag-filter i.l) .n + $(l t.l) + +++ display-filter +|= t=@t ^- ? +?: .=('blog' t) .n +(tag-filter t) + +++ tag-filter +|= t=@t ^- ? + ?: .=('blog' t) .n + ?: is-admin .y + ?: is-comet (~(has in public-tags) t) + =/ group (~(get by groups) t) + ?~ group .y + (~(has in u.group) him) + + ::?: .=('vip' t) (~(has in subscribers) him) + +:: Where are tags shown +:: 1. Blog postlists +:: 2. Blog post headers +:: 3. Board index +:: 4. Thread index :: actually not yet +:: 5. Thread show, below the main post +:: 6. People can jump in +:: need a list of routes that expose tags +++ public-tags ^- (set @t) +%- silt +:~ 'wyb' + 'public' + 'ngmi' + 'blog' +== +++ boards ^- (set @t) +?: is-comet public-tags +~(key by categories:const) + +++ is-comet ?=(%pawn (clan:title him)) +++ is-admin ^- ? +?| .=(him ~docteg-mothep) + .=((^sein:title him) ~docteg-mothep) +== +++ groups ^- (map @t (set @p)) +|^ + %- malt + :~ :- 'oldtianming' tianming + :- 'ogs' ogs + == + :: + ++ tianming ^- (set @p) + %- silt + :~ ~locpyl-tidnyd + ~torwes-minput + == + ++ ogs ^- (set @p) + %- silt + :~ ~sorwet + ~finnem + ~tiller-tolbus + ~torwes-minput + ~wispem-wantex + ~sogsyt-rammer + ~sivner-figbus + ~simtex-poster + ~libhut-samwes + ~sarlev-sarsen + ~samtyd-lodhet + ~wolrex-sabdun + ~ritpub-sipsyl + ~rignet-bicteg + ~ribben-donnyl + ~ribfel-lodfep + ~radbus-tactyl + ~pathus-hiddyn + ~mopfel-winrux + ~molsur-winnel + ~moddus-sorted + ~midlyx-hatrys + ~millyt-dorsen + ~midsum-salrux + ~micdeg-rinryl + ~master-morzod + ~locpyl-tidnyd + ~hansel-ribbur + ~fonner-batmul + ~fiprys + ~finned-palmer + ~datder-sonnet + ~bidhec-lopwyc + ~mirtyl-wacdec + ~polwex + ~mogtus-sanlux + == +-- +++ subscribers ^- (set @p) +%- silt +:~ ~polwex + ~wolrex-sabdun + ~mogtus-sanlux + ~sollyd-ritnux + ~bidhec-lopwyc +== ++$ substype $?(%base %urbit %full) ++$ subscription + $: started=@da + type=substype + period=$?(%monthly %yearly) + paid=payment + == ++$ payment + $% [%btc amount=@ud address=@t] + [%eth amount=@ud address=@ux] + [%other curr=@tas amount=@ud address=@t] + == ++$ subscription-map (map @p subscription) +++ subs ^- subscription-map + %- malt + :~ :- ~mogtus-sanlux `subscription`[~2024.3.1 %base %yearly %btc 0 ''] + :- ~wolrex-sabdun `subscription`[~2024.3.4 %base %yearly %eth 14 0x0] :: TODO get the currency unit right + :- ~sollyd-ritnux `subscription`[~2024.3.13 %base %yearly %other %sol 0 ''] :: TODO get the currency unit right + :- ~bidhec-lopwyc `subscription`[~2024.3.18 %base %yearly %other %btc 74 ''] :: TODO get the currency unit right + :- ~fiprys `subscription`[~2024.3.24 %full %yearly %other %eth 6 ''] :: TODO get the currency unit right + :- ~molsur-winnel `subscription`[~2024.8.1 %full %yearly %other %eth 6 ''] :: TODO get the currency unit right + :- ~sigmes-modfyn `subscription`[~2024.1.6 %base %yearly %other %usdt 50 ''] :: TODO get the currency unit right +== +++ subscription-type + |= now=@da ^- (unit substype) + ?: is-admin `%full + =/ sub (~(get by subs) him) + ?~ sub ~ + =/ expired %+ gte now + ?: ?=(%yearly period.u.sub) + (add ~d365 started.u.sub) + (add ~d30 started.u.sub) :: TODO use yore for this + ?: expired ~ %- some type.u.sub +-- |