From 31fff8bf1957adf0892d48da6b17cd47a7a8d90f Mon Sep 17 00:00:00 2001 From: default Date: Sat, 19 Aug 2023 17:16:30 +0200 Subject: [PATCH] Show current vote count on mouseover. --- html.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/html.c b/html.c index 2b690e9..e7e1d97 100644 --- a/html.c +++ b/html.c @@ -1220,13 +1220,16 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local, while (xs_list_iter(&p, &v)) { const char *name = xs_dict_get(v, "name"); + const xs_dict *replies = xs_dict_get(v, "replies"); if (name) { + int nr = xs_number_get(xs_dict_get(replies, "totalItems")); xs *es1 = encode_html(name); xs *opt = xs_fmt(" %s
\n", + " id=\"%s\" value=\"%s\"" + " name=\"question\"> %s
\n", !xs_is_null(oo) ? "radio" : "checkbox", - es1, es1, es1); + es1, es1, nr, es1); s1 = xs_str_cat(s1, opt); }