diff options
| -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"))); |