summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-08-29 07:33:42 +0200
committerGravatar default2024-08-29 07:33:42 +0200
commit52e8bfebd0084b0e0cfb90697bab5f62cb7979fe (patch)
tree1347f3250ca79afbb041a92c95b6ff045229562a
parentShow bookmarked posts with an emoji. (diff)
downloadsnac2-52e8bfebd0084b0e0cfb90697bab5f62cb7979fe.tar.gz
snac2-52e8bfebd0084b0e0cfb90697bab5f62cb7979fe.tar.xz
snac2-52e8bfebd0084b0e0cfb90697bab5f62cb7979fe.zip
Added links to pinned and bookmarked posts as if they were lists.
They still not work.
-rw-r--r--html.c58
1 files changed, 40 insertions, 18 deletions
diff --git a/html.c b/html.c
index 8b30c6c..b04966f 100644
--- a/html.c
+++ b/html.c
@@ -2157,29 +2157,51 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
2157 2157
2158 /* show links to the available lists */ 2158 /* show links to the available lists */
2159 if (user && !read_only) { 2159 if (user && !read_only) {
2160 xs_html *lol = xs_html_tag("ul",
2161 xs_html_attr("class", "snac-list-of-lists"));
2162 xs_html_add(body, lol);
2163
2160 xs *lists = list_maint(user, NULL, 0); /* get list of lists */ 2164 xs *lists = list_maint(user, NULL, 0); /* get list of lists */
2161 2165
2162 if (xs_list_len(lists)) { 2166 int ct = 0;
2163 int ct = 0; 2167 const char *v;
2164 const char *v;
2165 2168
2166 xs_html *lol = xs_html_tag("ul", 2169 while (xs_list_next(lists, &v, &ct)) {
2167 xs_html_attr("class", "snac-list-of-lists")); 2170 const char *lname = xs_list_get(v, 1);
2168 xs_html_add(body, lol); 2171 xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0));
2172 xs *ttl = xs_fmt(L("Timeline for list '%s'"), lname);
2169 2173
2170 while (xs_list_next(lists, &v, &ct)) { 2174 xs_html_add(lol,
2171 const char *lname = xs_list_get(v, 1); 2175 xs_html_tag("li",
2172 xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0)); 2176 xs_html_tag("a",
2173 xs *ttl = xs_fmt(L("Timeline for list '%s'"), lname); 2177 xs_html_attr("href", url),
2178 xs_html_attr("class", "snac-list-link"),
2179 xs_html_attr("title", ttl),
2180 xs_html_text(lname))));
2181 }
2174 2182
2175 xs_html_add(lol, 2183 {
2176 xs_html_tag("li", 2184 /* show the list of pinned posts */
2177 xs_html_tag("a", 2185 xs *url = xs_fmt("%s/list/pinned", user->actor);
2178 xs_html_attr("href", url), 2186 xs_html_add(lol,
2179 xs_html_attr("class", "snac-list-link"), 2187 xs_html_tag("li",
2180 xs_html_attr("title", ttl), 2188 xs_html_tag("a",
2181 xs_html_text(lname)))); 2189 xs_html_attr("href", url),
2182 } 2190 xs_html_attr("class", "snac-list-link"),
2191 xs_html_attr("title", L("Pinned posts")),
2192 xs_html_text("pinned"))));
2193 }
2194
2195 {
2196 /* show the list of bookmarked posts */
2197 xs *url = xs_fmt("%s/list/bookmarks", user->actor);
2198 xs_html_add(lol,
2199 xs_html_tag("li",
2200 xs_html_tag("a",
2201 xs_html_attr("href", url),
2202 xs_html_attr("class", "snac-list-link"),
2203 xs_html_attr("title", L("Bookmarked posts")),
2204 xs_html_text("bookmarks"))));
2183 } 2205 }
2184 } 2206 }
2185 2207