commit 8e7438b

default  ·  2023-11-28 10:14:28 +0000 UTC
parent 814bfdc
Finally, html_people() is the first page totally managed by xs_html.
1 files changed,  +10, -26
M html.c
M html.c
+10, -26
 1@@ -2274,35 +2274,19 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t)
 2 }
 3 
 4 
 5-xs_str *html_people(snac *snac)
 6+xs_str *html_people(snac *user)
 7 {
 8-    xs_str *s = xs_str_new(NULL);
 9-    xs *wing = following_list(snac);
10-    xs *wers = follower_list(snac);
11+    xs *wing = following_list(user);
12+    xs *wers = follower_list(user);
13 
14-    s = html_user_header(snac, s, 0);
15+    xs_html *html = xs_html_tag("html",
16+        html_user_head(user),
17+        xs_html_add(html_user_body(user, 0),
18+            html_people_list(user, wing, L("People you follow"), "i"),
19+            html_people_list(user, wers, L("People that follow you"), "e"),
20+            html_footer()));
21 
22-    {
23-        xs_html *h = html_people_list(snac, wing, L("People you follow"), "i");
24-        xs *s1 = xs_html_render(h);
25-        s = xs_str_cat(s, s1);
26-    }
27-
28-    {
29-        xs_html *h = html_people_list(snac, wers, L("People that follow you"), "e");
30-        xs *s1 = xs_html_render(h);
31-        s = xs_str_cat(s, s1);
32-    }
33-
34-    {
35-        xs_html *h = html_footer();
36-        xs *s1 = xs_html_render(h);
37-        s = xs_str_cat(s, s1);
38-    }
39-
40-    s = xs_str_cat(s, "</body>\n</html>\n");
41-
42-    return s;
43+    return xs_html_render_s(html, "<!DOCTYPE html>\n");
44 }
45 
46