commit d2a5a55
default
·
2023-11-23 20:04:11 +0000 UTC
parent 741302c
Use html_note() from html_people_list().
1 files changed,
+12,
-47
M
html.c
M
html.c
+12,
-47
1@@ -317,6 +317,7 @@ xs_html *html_note(snac *user, char *summary,
2 xs_html_attr("value", edit_id)));
3
4 xs_html_add(form,
5+ xs_html_tag("p", NULL),
6 xs_html_tag("details",
7 xs_html_tag("summary",
8 xs_html_text(L("Attachment..."))),
9@@ -332,10 +333,12 @@ xs_html *html_note(snac *user, char *summary,
10 /* add poll controls */
11 if (poll) {
12 xs_html_add(form,
13+ xs_html_tag("p", NULL),
14 xs_html_tag("details",
15 xs_html_tag("summary",
16 xs_html_text(L("Poll..."))),
17- xs_html_tag("p", NULL),
18+ xs_html_tag("p",
19+ xs_html_text(L("Poll options (one per line, up to 8):"))),
20 xs_html_tag("textarea",
21 xs_html_attr("class", "snac-textarea"),
22 xs_html_attr("name", "poll_options"),
23@@ -351,6 +354,7 @@ xs_html *html_note(snac *user, char *summary,
24 xs_html_tag("option",
25 xs_html_attr("value", "on"),
26 xs_html_text(L("Multiple choices")))),
27+ xs_html_text(" "),
28 xs_html_tag("select",
29 xs_html_attr("name", "poll_end_secs"),
30 xs_html_tag("option",
31@@ -1944,54 +1948,15 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head
32
33 /* the post textarea */
34 xs *dm_div_id = xs_fmt("%s_%s_dm", md5, t);
35- xs *dm_action = xs_fmt("%s/admin/note", snac->actor);
36 xs *dm_form_id = xs_fmt("%s_reply_form", md5);
37
38- xs_html *dm_textarea = xs_html_tag("div",
39- xs_html_tag("details",
40- xs_html_tag("summary",
41- xs_html_text(L("Direct Message..."))),
42- xs_html_tag("p", NULL),
43- xs_html_tag("div",
44- xs_html_attr("class", "snac-note"),
45- xs_html_attr("id", dm_div_id),
46- xs_html_tag("form",
47- xs_html_attr("autocomplete", "off"),
48- xs_html_attr("method", "post"),
49- xs_html_attr("action", dm_action),
50- xs_html_attr("enctype", "multipart/form-data"),
51- xs_html_attr("id", dm_form_id),
52- xs_html_tag("textarea",
53- xs_html_attr("class", "snac-textarea"),
54- xs_html_attr("name", "content"),
55- xs_html_attr("rows", "4"),
56- xs_html_attr("wrap", "virtual"),
57- xs_html_attr("required", "required"),
58- xs_html_attr("placeholder", ""),
59- xs_html_text("")),
60- xs_html_sctag("input",
61- xs_html_attr("type", "hidden"),
62- xs_html_attr("name", "to"),
63- xs_html_attr("value", actor_id)),
64- xs_html_tag("p", NULL),
65- xs_html_tag("details",
66- xs_html_tag("summary",
67- xs_html_text(L("Attachment..."))),
68- xs_html_tag("p", NULL),
69- xs_html_sctag("input",
70- xs_html_attr("type", "file"),
71- xs_html_attr("name", "attach")),
72- xs_html_sctag("input",
73- xs_html_attr("type", "text"),
74- xs_html_attr("name", "alt_text"),
75- xs_html_attr("placeholder", L("Attachment description")))),
76- xs_html_tag("p", NULL),
77- xs_html_sctag("input",
78- xs_html_attr("type", "submit"),
79- xs_html_attr("class", "button"),
80- xs_html_attr("value", L("Post")))),
81- xs_html_tag("p", NULL))),
82- xs_html_tag("p", NULL));
83+ xs_html *dm_textarea = html_note(snac, "Direct Message...",
84+ dm_div_id, dm_form_id,
85+ "", "",
86+ NULL, actor_id,
87+ xs_stock_false, "",
88+ xs_stock_false, NULL,
89+ NULL, 0);
90
91 xs_html_add(snac_controls, dm_textarea);
92