summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2026-01-25 10:20:35 +0100
committerGravatar grunfink2026-01-25 10:20:35 +0100
commitd30472f0d96bc9e2659db1cfe55ecf439796b989 (patch)
treeabef499186bdd8d84741f5979fb6964ff31cfc02 /html.c
parentUpdated language files. (diff)
parentpoll-limits: revert accidentally commited changes (diff)
downloadsnac2-d30472f0d96bc9e2659db1cfe55ecf439796b989.tar.gz
snac2-d30472f0d96bc9e2659db1cfe55ecf439796b989.tar.xz
snac2-d30472f0d96bc9e2659db1cfe55ecf439796b989.zip
Merge pull request 'Configurable limits for polls' (#534) from dandelions/snac2:poll-limits into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/534
Diffstat (limited to 'html.c')
-rw-r--r--html.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/html.c b/html.c
index 93dba0a..436995b 100644
--- a/html.c
+++ b/html.c
@@ -778,13 +778,18 @@ xs_html *html_note(snac *user, const char *summary,
778 778
779 /* add poll controls */ 779 /* add poll controls */
780 if (poll) { 780 if (poll) {
781 const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
782 xs *poll_limit_str = xs_dup(L("Poll options (one per line, up to 8):"));
783 if (max_options != NULL)
784 poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options));
785
781 xs_html_add(form, 786 xs_html_add(form,
782 xs_html_tag("p", NULL), 787 xs_html_tag("p", NULL),
783 xs_html_tag("details", 788 xs_html_tag("details",
784 xs_html_tag("summary", 789 xs_html_tag("summary",
785 xs_html_text(L("Poll..."))), 790 xs_html_text(L("Poll..."))),
786 xs_html_tag("p", 791 xs_html_tag("p",
787 xs_html_text(L("Poll options (one per line, up to 8):")), 792 xs_html_text(poll_limit_str),
788 xs_html_sctag("br", NULL), 793 xs_html_sctag("br", NULL),
789 xs_html_tag("textarea", 794 xs_html_tag("textarea",
790 xs_html_attr("class", "snac-textarea"), 795 xs_html_attr("class", "snac-textarea"),
@@ -812,7 +817,13 @@ xs_html *html_note(snac *user, const char *summary,
812 xs_html_text(L("End in 1 hour"))), 817 xs_html_text(L("End in 1 hour"))),
813 xs_html_tag("option", 818 xs_html_tag("option",
814 xs_html_attr("value", "86400"), 819 xs_html_attr("value", "86400"),
815 xs_html_text(L("End in 1 day")))))); 820 xs_html_text(L("End in 1 day"))),
821 xs_html_tag("option",
822 xs_html_attr("value", "259200"),
823 xs_html_text(L("End in 3 days"))),
824 xs_html_tag("option",
825 xs_html_attr("value", "31536000"),
826 xs_html_text(L("End in 1 year"))))));
816 } 827 }
817 828
818 xs_html_add(form, 829 xs_html_add(form,