summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-24 12:12:03 +0200
committerdefault <nobody@localhost>2024-05-24 12:12:03 +0200
commita787c818b2c52b5bf30d13bb8f3490a92dd8bdcb (patch)
tree04e57481f337fe0b2f8fe9a7c1f4e6c57eefd5fa /html.c
parentfcead8ea9686d4707f95e9249d955284d22d4ec2 (diff)
Added links to the lists in html_timeline().
Diffstat (limited to 'html.c')
-rw-r--r--html.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/html.c b/html.c
index 11fe4bf..a9b82da 100644
--- a/html.c
+++ b/html.c
@@ -2066,6 +2066,31 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
xs_html_text(title)));
}
+ /* show links to the available lists */
+ {
+ xs *lists = list_maint(user, NULL, 0); /* get list of lists */
+
+ if (xs_list_len(lists)) {
+ int ct = 0;
+ const char *v;
+
+ xs_html *lol = xs_html_tag("ul",
+ xs_html_attr("class", "snac-list-of-lists"));
+ xs_html_add(body, lol);
+
+ while (xs_list_next(lists, &v, &ct)) {
+ xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0));
+
+ xs_html_add(lol,
+ xs_html_tag("li",
+ xs_html_tag("a",
+ xs_html_attr("href", url),
+ xs_html_attr("class", "snac-list-link"),
+ xs_html_text(xs_list_get(v, 1)))));
+ }
+ }
+ }
+
xs_html_add(body,
xs_html_tag("a",
xs_html_attr("name", "snac-posts")));