26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
render_tweet_page(
co: &lib.srv.convo,
path: lib.mem.ptr(pref),
p: &lib.store.post
): {}
var livetime = co.srv:thread_latest_arrival_calc(p.id)
var pg: lib.str.acc pg:init(256)
pg:lpush('<div data-live="10">') -- make the OP refresh too
lib.render.tweet(co, p, &pg)
pg:lpush('</div>')
if co.aid ~= 0 then
pg:lpush('<form class="action-bar" method="post">')
if not co.srv:post_liked_uid(co.who.id, p.id)
................................................................................
render_tweet_replies(co, &pg, p.id)
pg:lpush('</div>')
if co.aid ~= 0 and co.who.rights.powers.post() then
lib.render.compose(co, nil, &pg)
end
var ppg = pg:finalize() defer ppg:free()
co:livepage([lib.srv.convo.page] {
title = lib.str.plit 'post'; cache = false;
class = lib.str.plit 'post'; body = ppg;
}, livetime)
-- TODO display conversation
-- perhaps display descendant nodes here, and have a link to the top of the whole tree?
end
return render_tweet_page
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
render_tweet_page(
co: &lib.srv.convo,
path: lib.mem.ptr(pref),
p: &lib.store.post
): {}
var livetime = co.srv:thread_latest_arrival_calc(p.id)
var pg = co:stra(256)
pg:lpush('<div data-live="10">') -- make the OP refresh too
lib.render.tweet(co, p, &pg)
pg:lpush('</div>')
if co.aid ~= 0 then
pg:lpush('<form class="action-bar" method="post">')
if not co.srv:post_liked_uid(co.who.id, p.id)
................................................................................
render_tweet_replies(co, &pg, p.id)
pg:lpush('</div>')
if co.aid ~= 0 and co.who.rights.powers.post() then
lib.render.compose(co, nil, &pg)
end
var ppg = pg:finalize() --defer ppg:free()
co:livepage([lib.srv.convo.page] {
title = lib.str.plit 'post'; cache = false;
class = lib.str.plit 'post'; body = ppg;
}, livetime)
-- TODO display conversation
-- perhaps display descendant nodes here, and have a link to the top of the whole tree?
end
return render_tweet_page
|