diff options
| author | 2025-04-12 21:56:23 +0200 | |
|---|---|---|
| committer | 2026-01-24 02:23:16 +0100 | |
| commit | 50129db64b70604d347c2f21be5e5182080c6e07 (patch) | |
| tree | c1753b574db1052897276b4180ef57854f437260 /html.c | |
| parent | Merge pull request 'add susie-q (qr) to artwork' (#528) from pmjv/snac2:maste... (diff) | |
| download | snac2-50129db64b70604d347c2f21be5e5182080c6e07.tar.gz snac2-50129db64b70604d347c2f21be5e5182080c6e07.tar.xz snac2-50129db64b70604d347c2f21be5e5182080c6e07.zip | |
small: configurable poll limit
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -778,13 +778,17 @@ 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 | poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options)); | ||
| 784 | |||
| 781 | xs_html_add(form, | 785 | xs_html_add(form, |
| 782 | xs_html_tag("p", NULL), | 786 | xs_html_tag("p", NULL), |
| 783 | xs_html_tag("details", | 787 | xs_html_tag("details", |
| 784 | xs_html_tag("summary", | 788 | xs_html_tag("summary", |
| 785 | xs_html_text(L("Poll..."))), | 789 | xs_html_text(L("Poll..."))), |
| 786 | xs_html_tag("p", | 790 | xs_html_tag("p", |
| 787 | xs_html_text(L("Poll options (one per line, up to 8):")), | 791 | xs_html_text(poll_limit_str), |
| 788 | xs_html_sctag("br", NULL), | 792 | xs_html_sctag("br", NULL), |
| 789 | xs_html_tag("textarea", | 793 | xs_html_tag("textarea", |
| 790 | xs_html_attr("class", "snac-textarea"), | 794 | xs_html_attr("class", "snac-textarea"), |