summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-08-19 17:16:30 +0200
committerdefault <nobody@localhost>2023-08-19 17:16:30 +0200
commit31fff8bf1957adf0892d48da6b17cd47a7a8d90f (patch)
tree2ab0e09af6d8c1f3ad13799b10183852d69fbd64 /html.c
parentfa2d818c416f553d19c735fe62c045ac131214f8 (diff)
Show current vote count on mouseover.
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files 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("<input type=\"%s\""
- " id=\"%s\" value=\"%s\" name=\"question\"> %s<br>\n",
+ " id=\"%s\" value=\"%s\""
+ " name=\"question\"> <span title=\"%d\">%s</span><br>\n",
!xs_is_null(oo) ? "radio" : "checkbox",
- es1, es1, es1);
+ es1, es1, nr, es1);
s1 = xs_str_cat(s1, opt);
}