diff options
| author | 2023-11-28 11:14:28 +0100 | |
|---|---|---|
| committer | 2023-11-28 11:14:28 +0100 | |
| commit | 8e7438bca6c3022af02794bb844d963e19f9b8a9 (patch) | |
| tree | 64e2ca3a34b51b4edcc24fa198619fa667e49eda /html.c | |
| parent | New function html_user_body() (still unused). (diff) | |
| download | snac2-8e7438bca6c3022af02794bb844d963e19f9b8a9.tar.gz snac2-8e7438bca6c3022af02794bb844d963e19f9b8a9.tar.xz snac2-8e7438bca6c3022af02794bb844d963e19f9b8a9.zip | |
Finally, html_people() is the first page totally managed by xs_html.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 36 |
1 files changed, 10 insertions, 26 deletions
| @@ -2274,35 +2274,19 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t) | |||
| 2274 | } | 2274 | } |
| 2275 | 2275 | ||
| 2276 | 2276 | ||
| 2277 | xs_str *html_people(snac *snac) | 2277 | xs_str *html_people(snac *user) |
| 2278 | { | 2278 | { |
| 2279 | xs_str *s = xs_str_new(NULL); | 2279 | xs *wing = following_list(user); |
| 2280 | xs *wing = following_list(snac); | 2280 | xs *wers = follower_list(user); |
| 2281 | xs *wers = follower_list(snac); | ||
| 2282 | 2281 | ||
| 2283 | s = html_user_header(snac, s, 0); | 2282 | xs_html *html = xs_html_tag("html", |
| 2283 | html_user_head(user), | ||
| 2284 | xs_html_add(html_user_body(user, 0), | ||
| 2285 | html_people_list(user, wing, L("People you follow"), "i"), | ||
| 2286 | html_people_list(user, wers, L("People that follow you"), "e"), | ||
| 2287 | html_footer())); | ||
| 2284 | 2288 | ||
| 2285 | { | 2289 | return xs_html_render_s(html, "<!DOCTYPE html>\n"); |
| 2286 | xs_html *h = html_people_list(snac, wing, L("People you follow"), "i"); | ||
| 2287 | xs *s1 = xs_html_render(h); | ||
| 2288 | s = xs_str_cat(s, s1); | ||
| 2289 | } | ||
| 2290 | |||
| 2291 | { | ||
| 2292 | xs_html *h = html_people_list(snac, wers, L("People that follow you"), "e"); | ||
| 2293 | xs *s1 = xs_html_render(h); | ||
| 2294 | s = xs_str_cat(s, s1); | ||
| 2295 | } | ||
| 2296 | |||
| 2297 | { | ||
| 2298 | xs_html *h = html_footer(); | ||
| 2299 | xs *s1 = xs_html_render(h); | ||
| 2300 | s = xs_str_cat(s, s1); | ||
| 2301 | } | ||
| 2302 | |||
| 2303 | s = xs_str_cat(s, "</body>\n</html>\n"); | ||
| 2304 | |||
| 2305 | return s; | ||
| 2306 | } | 2290 | } |
| 2307 | 2291 | ||
| 2308 | 2292 | ||