summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/html.c b/html.c
index 37a884f..3e50648 100644
--- a/html.c
+++ b/html.c
@@ -384,7 +384,10 @@ d_char *html_top_controls(snac *snac, d_char *s)
384 "<p>%s:<br>\n" 384 "<p>%s:<br>\n"
385 "<textarea class=\"snac-textarea\" name=\"poll_options\" " 385 "<textarea class=\"snac-textarea\" name=\"poll_options\" "
386 "rows=\"6\" wrap=\"virtual\"></textarea>\n" 386 "rows=\"6\" wrap=\"virtual\"></textarea>\n"
387 "<p>%s: <input type=\"checkbox\" name=\"poll_multiple\">\n" 387 "<p><select name=\"poll_multiple\">\n"
388 "<option value=\"off\">%s</option>\n"
389 "<option value=\"on\">%s</option>\n"
390 "</select>\n"
388 "<select name=\"poll_end_secs\" id=\"poll_end_secs\">\n" 391 "<select name=\"poll_end_secs\" id=\"poll_end_secs\">\n"
389 "<option value=\"300\">%s</option>\n" 392 "<option value=\"300\">%s</option>\n"
390 "<option value=\"3600\">%s</option>\n" 393 "<option value=\"3600\">%s</option>\n"
@@ -495,10 +498,11 @@ d_char *html_top_controls(snac *snac, d_char *s)
495 498
496 L("Poll..."), 499 L("Poll..."),
497 L("Poll options (one per line, up to 8)"), 500 L("Poll options (one per line, up to 8)"),
498 L("Multiple"), 501 L("One choice"),
499 L("5 minutes"), 502 L("Multiple choices"),
500 L("1 hour"), 503 L("End in 5 minutes"),
501 L("1 day"), 504 L("End in 1 hour"),
505 L("End in 1 day"),
502 506
503 L("Post"), 507 L("Post"),
504 508
@@ -1834,9 +1838,12 @@ int html_post_handler(const xs_dict *req, const char *q_path,
1834 /* get the rest of poll configuration */ 1838 /* get the rest of poll configuration */
1835 const char *p_multiple = xs_dict_get(p_vars, "poll_multiple"); 1839 const char *p_multiple = xs_dict_get(p_vars, "poll_multiple");
1836 const char *p_end_secs = xs_dict_get(p_vars, "poll_end_secs"); 1840 const char *p_end_secs = xs_dict_get(p_vars, "poll_end_secs");
1841 int multiple = 0;
1837 1842
1838 int end_secs = atoi(!xs_is_null(p_end_secs) ? p_end_secs : "60"); 1843 int end_secs = atoi(!xs_is_null(p_end_secs) ? p_end_secs : "60");
1839 int multiple = !xs_is_null(p_multiple); 1844
1845 if (!xs_is_null(p_multiple) && strcmp(p_multiple, "on") == 0)
1846 multiple = 1;
1840 1847
1841 msg = msg_question(&snac, content_2, attach_list, 1848 msg = msg_question(&snac, content_2, attach_list,
1842 poll_opts, multiple, end_secs); 1849 poll_opts, multiple, end_secs);