summaryrefslogtreecommitdiff
path: root/desk/web/root.hoon
blob: ceb6e19252e38e1ad336af86d7e8977e3de0e7de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/-  b=boke, tp=trill-post, c=tlon-channels
/+  fetch-lib=fetch, sr=sortug
/=  chat-page  /web/chat/chat
|_  [s=state:b =bowl:gall]
+*  fetch  ~(. fetch-lib [s bowl])
++  css  ^~  %-  trip
'''
section{
  display: flex;
  width: 100%;
  & .a{
    width: 50%;
  }
}
h2{
  padding-bottom: 0.2rem;
  border-bottom: 1px solid black;
  text-align: center;
}
.chat-author{
  margin-right: 1ch;
}
.preview{
  padding: 0 0.8rem;
  text-align: left;
}
'''
++  last-blog   (thread-page-by-tags:fetch ~['blog'] [~ ~ 5] ~)
++  last-board  (thread-page-no-wall:fetch [~ ~ 5] (some |=(t=thread:tp !(~(has in tags.t) 'blog'))))
++  last-chat
  =/  pat  /chat/(scot %p our.bowl)/chat/posts/newest/5/post
  =/  scry  ~(scry io:sr bowl)
  =/  chat-posts  (scry %channels pat paged-posts:c)
  (tap:on-posts:c posts.chat-posts)
++  last-feed
:: TODO if gates show only spandrell4 posts
%ok
++  $
=/  blog   last-blog
=/  board  last-board
=/  chat   last-chat
=/  feed   last-feed
;div.blog
  ;style:"{css}"
  ;div
    ;h2: Now playing on Spandrell TV
    ;a/"/tv":"Dune Week!"
    ;p:"Dune (1984), Dune Part One (2021), Dune (2000 Mini Series), Children of dune (2003 Mini Series)"
  ==
  ;section
    ;div.a.blog-activity
      ;h2: Last on Blog
      ;ul.preview
      ;*  %+  turn  p.blog  |=  t=thread:tp
        ;li
          ;a/"{(trip (spat path.t))}":"{(trip title.t)}"
        ==
      ==
    ==
    ;div.a.board-activity
      ;h2: Last on Board
      ;ul.preview
      ;*  %+  turn  p.board  |=  t=thread:tp
        ;li
          ;a/"{(trip (spat (weld /board path.t)))}":"{(trip title.t)}"
        ==
      ==
    ==
  ==
  ;section
    ;div.a.chat-activity
      ;h2: Last on Chat
      ;*  %+  turn  chat  |=  [time=@da up=(unit post:c)]
      ?~  up  ;span;  =/  memo  +<.u.up
      =/  author  ?:  ?=(%pawn (clan:title author.memo))  "anon"  (scow %p author.memo)
      ;a/"/chat"
        ;*  %+  turn  content.memo  |=  =verse:c
        ?:  ?=(%block -.verse)  ;span;
        ;div.preview.inline
          ;span.chat-author:"{author}:"
          ;*  %+  turn  p.verse  tinline:chat-page
        ==
      ==
    ==
    ;div.a.feed-activity
      ;h2: Last on Feed
      ;a/"/feed":"Coming soon!"
    ==
  ==
==
--