From 485986dab9ab0ee59c5829f85c6b066f6bfa3d72 Mon Sep 17 00:00:00 2001 From: byte Date: Fri, 16 Jan 2026 21:11:42 +0000 Subject: simple cosmetic counters --- html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html.c b/html.c index a11b448..86620fb 100644 --- a/html.c +++ b/html.c @@ -3710,7 +3710,7 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c xs_html *people = xs_html_tag("div", xs_html_tag("h2", xs_html_attr("class", "snac-header"), - xs_html_text(header)), + xs_html_raw(xs_fmt("%s - %d\n", header, xs_list_len(list)))), snac_posts = xs_html_tag("details", xs_html_attr("open", NULL), xs_html_tag("summary", -- cgit v1.2.3 From 1719c1fe95017faa1a75ba58c5391e05eb2e772e Mon Sep 17 00:00:00 2001 From: byte Date: Sat, 17 Jan 2026 02:45:33 +0000 Subject: doing count conditional --- html.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/html.c b/html.c index 86620fb..c834fcf 100644 --- a/html.c +++ b/html.c @@ -3704,13 +3704,19 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, } -xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy) +xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy, int do_count) { xs_html *snac_posts; + const char *header_cnt; + if (do_count) + header_cnt = xs_fmt("%s - %d\n", header, xs_list_len(list)); + else + header_cnt = xs_fmt("%s\n", header); + xs_html *people = xs_html_tag("div", xs_html_tag("h2", xs_html_attr("class", "snac-header"), - xs_html_raw(xs_fmt("%s - %d\n", header, xs_list_len(list)))), + xs_html_raw(header_cnt)), snac_posts = xs_html_tag("details", xs_html_attr("open", NULL), xs_html_tag("summary", @@ -3951,12 +3957,12 @@ xs_str *html_people(snac *user) if (xs_list_len(pending) || xs_is_true(xs_dict_get(user->config, "approve_followers"))) { xs_html_add(lists, - html_people_list(user, pending, L("Pending follow confirmations"), "p", proxy)); + html_people_list(user, pending, L("Pending follow confirmations"), "p", proxy, 1)); } xs_html_add(lists, - html_people_list(user, wing, L("People you follow"), "i", proxy), - html_people_list(user, wers, L("People that follow you"), "e", proxy)); + html_people_list(user, wing, L("People you follow"), "i", proxy, 1), + html_people_list(user, wers, L("People that follow you"), "e", proxy, 1)); xs_html *html = xs_html_tag("html", html_user_head(user, NULL, NULL), @@ -3987,7 +3993,7 @@ xs_str *html_people_one(snac *user, const char *actor, const xs_list *list, xs *foll = xs_list_append(xs_list_new(), actor); xs_html_add(lists, - html_people_list(user, foll, L("Contact's posts"), "p", proxy)); + html_people_list(user, foll, L("Contact's posts"), "p", proxy, 0)); xs_html_add(body, lists); @@ -4641,7 +4647,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, xs *title = xs_fmt(L("Search results for account %s"), q); - page = html_people_list(&snac, l, title, "wf", NULL); + page = html_people_list(&snac, l, title, "wf", NULL, 1); } } -- cgit v1.2.3