diff options
| author | 2024-05-24 12:12:03 +0200 | |
|---|---|---|
| committer | 2024-05-24 12:12:03 +0200 | |
| commit | a787c818b2c52b5bf30d13bb8f3490a92dd8bdcb (patch) | |
| tree | 04e57481f337fe0b2f8fe9a7c1f4e6c57eefd5fa | |
| parent | Also delete the list .idx.bak. (diff) | |
| download | snac2-a787c818b2c52b5bf30d13bb8f3490a92dd8bdcb.tar.gz snac2-a787c818b2c52b5bf30d13bb8f3490a92dd8bdcb.tar.xz snac2-a787c818b2c52b5bf30d13bb8f3490a92dd8bdcb.zip | |
Added links to the lists in html_timeline().
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | html.c | 25 |
2 files changed, 26 insertions, 1 deletions
| @@ -1832,7 +1832,7 @@ xs_val *list_maint(snac *user, const char *list, int op) | |||
| 1832 | fn = xs_replace_i(fn, ".lst", ".idx"); | 1832 | fn = xs_replace_i(fn, ".lst", ".idx"); |
| 1833 | unlink(fn); | 1833 | unlink(fn); |
| 1834 | 1834 | ||
| 1835 | fn = xs_append(fn, ".bak"); | 1835 | fn = xs_str_cat(fn, ".bak"); |
| 1836 | unlink(fn); | 1836 | unlink(fn); |
| 1837 | } | 1837 | } |
| 1838 | } | 1838 | } |
| @@ -2066,6 +2066,31 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2066 | xs_html_text(title))); | 2066 | xs_html_text(title))); |
| 2067 | } | 2067 | } |
| 2068 | 2068 | ||
| 2069 | /* show links to the available lists */ | ||
| 2070 | { | ||
| 2071 | xs *lists = list_maint(user, NULL, 0); /* get list of lists */ | ||
| 2072 | |||
| 2073 | if (xs_list_len(lists)) { | ||
| 2074 | int ct = 0; | ||
| 2075 | const char *v; | ||
| 2076 | |||
| 2077 | xs_html *lol = xs_html_tag("ul", | ||
| 2078 | xs_html_attr("class", "snac-list-of-lists")); | ||
| 2079 | xs_html_add(body, lol); | ||
| 2080 | |||
| 2081 | while (xs_list_next(lists, &v, &ct)) { | ||
| 2082 | xs *url = xs_fmt("%s/list/%s", user->actor, xs_list_get(v, 0)); | ||
| 2083 | |||
| 2084 | xs_html_add(lol, | ||
| 2085 | xs_html_tag("li", | ||
| 2086 | xs_html_tag("a", | ||
| 2087 | xs_html_attr("href", url), | ||
| 2088 | xs_html_attr("class", "snac-list-link"), | ||
| 2089 | xs_html_text(xs_list_get(v, 1))))); | ||
| 2090 | } | ||
| 2091 | } | ||
| 2092 | } | ||
| 2093 | |||
| 2069 | xs_html_add(body, | 2094 | xs_html_add(body, |
| 2070 | xs_html_tag("a", | 2095 | xs_html_tag("a", |
| 2071 | xs_html_attr("name", "snac-posts"))); | 2096 | xs_html_attr("name", "snac-posts"))); |