diff options
author | default <nobody@localhost> | 2024-08-29 07:33:42 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-08-29 07:33:42 +0200 |
commit | 52e8bfebd0084b0e0cfb90697bab5f62cb7979fe (patch) | |
tree | 1347f3250ca79afbb041a92c95b6ff045229562a /html.c | |
parent | 53581361326f6f87a92ea47f03b09dd7b8dea631 (diff) |
Added links to pinned and bookmarked posts as if they were lists.
They still not work.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 58 |
1 files changed, 40 insertions, 18 deletions
@@ -2157,29 +2157,51 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, /* show links to the available lists */ if (user && !read_only) { + xs_html *lol = xs_html_tag("ul", + xs_html_attr("class", "snac-list-of-lists")); + xs_html_add(body, lol); + xs *lists = list_maint(user, NULL, 0); /* get list of lists */ - if (xs_list_len(lists)) { - int ct = 0; - const char *v; + 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)) { + const char *lname = xs_list_get(v, 1); + xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0)); + xs *ttl = xs_fmt(L("Timeline for list '%s'"), lname); - while (xs_list_next(lists, &v, &ct)) { - const char *lname = xs_list_get(v, 1); - xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0)); - xs *ttl = xs_fmt(L("Timeline for list '%s'"), lname); + 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_attr("title", ttl), + xs_html_text(lname)))); + } - 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_attr("title", ttl), - xs_html_text(lname)))); - } + { + /* show the list of pinned posts */ + xs *url = xs_fmt("%s/list/pinned", user->actor); + 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_attr("title", L("Pinned posts")), + xs_html_text("pinned")))); + } + + { + /* show the list of bookmarked posts */ + xs *url = xs_fmt("%s/list/bookmarks", user->actor); + 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_attr("title", L("Bookmarked posts")), + xs_html_text("bookmarks")))); } } |