commit d3cdbf1

default  ·  2024-05-07 18:51:43 +0000 UTC
parent 3355d55
Added a title to list timelines.
1 files changed,  +10, -1
M html.c
M html.c
+10, -1
 1@@ -2034,6 +2034,13 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
 2         xs_html_add(body,
 3             html_top_controls(user));
 4 
 5+    if (user && title) {
 6+        xs_html_add(body,
 7+            xs_html_tag("h2",
 8+                xs_html_attr("class", "snac-header"),
 9+                xs_html_text(title)));
10+    }
11+
12     xs_html_add(body,
13         xs_html_tag("a",
14             xs_html_attr("name", "snac-posts")));
15@@ -2666,9 +2673,11 @@ int html_get_handler(const xs_dict *req, const char *q_path,
16 
17             if (list != NULL) {
18                 xs *base = xs_fmt("/list/%s", lid);
19+                xs *name = list_maint(&snac, lid, 3);
20+                xs *title = xs_fmt(L("Showing timeline for list %s"), name);
21 
22                 *body = html_timeline(&snac, list, 0, skip, show,
23-                    xs_list_len(next), NULL, base, 1);
24+                    xs_list_len(next), title, base, 1);
25                 *b_size = strlen(*body);
26                 status  = 200;
27             }