diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 15 |
1 files changed, 13 insertions, 2 deletions
| @@ -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, |