Added links to pinned and bookmarked posts as if they were lists.

They still not work.
This commit is contained in:
default 2024-08-29 07:33:42 +02:00
parent 5358136132
commit 52e8bfebd0

34
html.c
View file

@ -2157,16 +2157,15 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
/* show links to the available lists */ /* show links to the available lists */
if (user && !read_only) { if (user && !read_only) {
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 *lol = xs_html_tag("ul",
xs_html_attr("class", "snac-list-of-lists")); xs_html_attr("class", "snac-list-of-lists"));
xs_html_add(body, lol); xs_html_add(body, lol);
xs *lists = list_maint(user, NULL, 0); /* get list of lists */
int ct = 0;
const char *v;
while (xs_list_next(lists, &v, &ct)) { while (xs_list_next(lists, &v, &ct)) {
const char *lname = xs_list_get(v, 1); const char *lname = xs_list_get(v, 1);
xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0)); xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0));
@ -2180,6 +2179,29 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
xs_html_attr("title", ttl), xs_html_attr("title", ttl),
xs_html_text(lname)))); 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"))));
} }
} }