summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2026-01-17 05:22:25 +0100
committerGravatar grunfink2026-01-17 05:22:25 +0100
commit33b066733eb3f7f106056dcba42518e62de33588 (patch)
tree60884a7cfa97f042434d58f9022f715cbc2d6f36 /html.c
parentUpdated RELEASE_NOTES. (diff)
parentdoing count conditional (diff)
downloadsnac2-33b066733eb3f7f106056dcba42518e62de33588.tar.gz
snac2-33b066733eb3f7f106056dcba42518e62de33588.tar.xz
snac2-33b066733eb3f7f106056dcba42518e62de33588.zip
Merge pull request 'simple cosmetic counters' (#519) from byte/snac2:counters into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/519
Diffstat (limited to 'html.c')
-rw-r--r--html.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/html.c b/html.c
index b4cb1c7..1a25eaa 100644
--- a/html.c
+++ b/html.c
@@ -3707,13 +3707,19 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
3707} 3707}
3708 3708
3709 3709
3710xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy) 3710xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy, int do_count)
3711{ 3711{
3712 xs_html *snac_posts; 3712 xs_html *snac_posts;
3713 const char *header_cnt;
3714 if (do_count)
3715 header_cnt = xs_fmt("%s - %d\n", header, xs_list_len(list));
3716 else
3717 header_cnt = xs_fmt("%s\n", header);
3718
3713 xs_html *people = xs_html_tag("div", 3719 xs_html *people = xs_html_tag("div",
3714 xs_html_tag("h2", 3720 xs_html_tag("h2",
3715 xs_html_attr("class", "snac-header"), 3721 xs_html_attr("class", "snac-header"),
3716 xs_html_text(header)), 3722 xs_html_raw(header_cnt)),
3717 snac_posts = xs_html_tag("details", 3723 snac_posts = xs_html_tag("details",
3718 xs_html_attr("open", NULL), 3724 xs_html_attr("open", NULL),
3719 xs_html_tag("summary", 3725 xs_html_tag("summary",
@@ -3954,12 +3960,12 @@ xs_str *html_people(snac *user)
3954 3960
3955 if (xs_list_len(pending) || xs_is_true(xs_dict_get(user->config, "approve_followers"))) { 3961 if (xs_list_len(pending) || xs_is_true(xs_dict_get(user->config, "approve_followers"))) {
3956 xs_html_add(lists, 3962 xs_html_add(lists,
3957 html_people_list(user, pending, L("Pending follow confirmations"), "p", proxy)); 3963 html_people_list(user, pending, L("Pending follow confirmations"), "p", proxy, 1));
3958 } 3964 }
3959 3965
3960 xs_html_add(lists, 3966 xs_html_add(lists,
3961 html_people_list(user, wing, L("People you follow"), "i", proxy), 3967 html_people_list(user, wing, L("People you follow"), "i", proxy, 1),
3962 html_people_list(user, wers, L("People that follow you"), "e", proxy)); 3968 html_people_list(user, wers, L("People that follow you"), "e", proxy, 1));
3963 3969
3964 xs_html *html = xs_html_tag("html", 3970 xs_html *html = xs_html_tag("html",
3965 html_user_head(user, NULL, NULL), 3971 html_user_head(user, NULL, NULL),
@@ -3990,7 +3996,7 @@ xs_str *html_people_one(snac *user, const char *actor, const xs_list *list,
3990 xs *foll = xs_list_append(xs_list_new(), actor); 3996 xs *foll = xs_list_append(xs_list_new(), actor);
3991 3997
3992 xs_html_add(lists, 3998 xs_html_add(lists,
3993 html_people_list(user, foll, L("Contact's posts"), "p", proxy)); 3999 html_people_list(user, foll, L("Contact's posts"), "p", proxy, 0));
3994 4000
3995 xs_html_add(body, lists); 4001 xs_html_add(body, lists);
3996 4002
@@ -4644,7 +4650,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
4644 4650
4645 xs *title = xs_fmt(L("Search results for account %s"), q); 4651 xs *title = xs_fmt(L("Search results for account %s"), q);
4646 4652
4647 page = html_people_list(&snac, l, title, "wf", NULL); 4653 page = html_people_list(&snac, l, title, "wf", NULL, 1);
4648 } 4654 }
4649 } 4655 }
4650 4656