diff options
| author | 2023-05-24 10:23:57 +0200 | |
|---|---|---|
| committer | 2023-05-24 10:23:57 +0200 | |
| commit | 4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba (patch) | |
| tree | 591d5ae43f158ceca5362fb860cae242cb7d3349 /html.c | |
| parent | Finished polls are shown. (diff) | |
| download | snac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.tar.gz snac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.tar.xz snac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.zip | |
Show a ballot box emoji in the score if the enttry it's a poll.
Diffstat (limited to 'html.c')
| -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, | |||
| 745 | if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) | 745 | if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) |
| 746 | return os; | 746 | return os; |
| 747 | 747 | ||
| 748 | s = xs_str_cat(s, "<div class=\"snac-score\">"); | ||
| 749 | |||
| 750 | if (strcmp(type, "Question") == 0) { | ||
| 751 | /* add the ballot box emoji */ | ||
| 752 | xs *f = xs_fmt("<span title=\"%s\"> 🗳 </span>", L("Poll")); | ||
| 753 | s = xs_str_cat(s, f); | ||
| 754 | } | ||
| 755 | |||
| 748 | /* if this is our post, add the score */ | 756 | /* if this is our post, add the score */ |
| 749 | if (xs_startswith(id, snac->actor)) { | 757 | if (xs_startswith(id, snac->actor)) { |
| 750 | int n_likes = object_likes_len(id); | 758 | 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, | |||
| 752 | 760 | ||
| 753 | /* alternate emojis: %d 👍 %d 🔁 */ | 761 | /* alternate emojis: %d 👍 %d 🔁 */ |
| 754 | 762 | ||
| 755 | xs *s1 = xs_fmt( | 763 | xs *s1 = xs_fmt("%d ★ %d ↺\n", n_likes, n_boosts); |
| 756 | "<div class=\"snac-score\">%d ★ %d ↺</div>\n", | ||
| 757 | n_likes, n_boosts); | ||
| 758 | 764 | ||
| 759 | s = xs_str_cat(s, s1); | 765 | s = xs_str_cat(s, s1); |
| 760 | } | 766 | } |
| 761 | 767 | ||
| 768 | s = xs_str_cat(s, "</div>\n"); | ||
| 769 | |||
| 762 | if (level == 0) | 770 | if (level == 0) |
| 763 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); | 771 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); |
| 764 | else | 772 | else |