diff options
author | default <nobody@localhost> | 2023-05-24 10:23:57 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-05-24 10:23:57 +0200 |
commit | 4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba (patch) | |
tree | 591d5ae43f158ceca5362fb860cae242cb7d3349 | |
parent | 2b6d6d3412b13ca7b91ddfaa320f5e37a2357d3f (diff) |
Show a ballot box emoji in the score if the enttry it's a poll.
-rw-r--r-- | html.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -745,6 +745,14 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) return os; + s = xs_str_cat(s, "<div class=\"snac-score\">"); + + if (strcmp(type, "Question") == 0) { + /* add the ballot box emoji */ + xs *f = xs_fmt("<span title=\"%s\"> 🗳 </span>", L("Poll")); + s = xs_str_cat(s, f); + } + /* if this is our post, add the score */ if (xs_startswith(id, snac->actor)) { int n_likes = object_likes_len(id); @@ -752,13 +760,13 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, /* alternate emojis: %d 👍 %d 🔁 */ - xs *s1 = xs_fmt( - "<div class=\"snac-score\">%d ★ %d ↺</div>\n", - n_likes, n_boosts); + xs *s1 = xs_fmt("%d ★ %d ↺\n", n_likes, n_boosts); s = xs_str_cat(s, s1); } + s = xs_str_cat(s, "</div>\n"); + if (level == 0) s = xs_str_cat(s, "<div class=\"snac-post\">\n"); else |