commit 6417d23
default
·
2023-11-26 18:15:43 +0000 UTC
parent daad4ee
Use html_note() in html_top_controls().
1 files changed,
+10,
-59
M
html.c
M
html.c
+10,
-59
1@@ -288,7 +288,7 @@ xs_html *html_note(snac *user, char *summary,
2 /* no actor_id; ask for mentioned_only */
3 xs_html_add(form,
4 xs_html_tag("p", NULL),
5- xs_html_text(L("Only for mentioned people")),
6+ xs_html_text(L("Only for mentioned people: ")),
7 xs_html_sctag("input",
8 xs_html_attr("type", "checkbox"),
9 xs_html_attr("name", "mentioned_only"),
10@@ -712,44 +712,6 @@ xs_str *html_user_header(snac *snac, xs_str *s, int local)
11 xs_str *html_top_controls(snac *snac, xs_str *s)
12 /* generates the top controls */
13 {
14- char *_tmpl =
15- "<div class=\"snac-note\">\n"
16- "<details><summary>%s</summary>\n"
17- "<form autocomplete=\"off\" method=\"post\" "
18- "action=\"%s/admin/note\" enctype=\"multipart/form-data\">\n"
19- "<textarea class=\"snac-textarea\" name=\"content\" "
20- "rows=\"8\" wrap=\"virtual\" required=\"required\" placeholder=\"What's on your mind?\"></textarea>\n"
21- "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n"
22- "<p>%s: <input type=\"checkbox\" name=\"sensitive\"> "
23- "<input type=\"text\" name=\"summary\" placeholder=\"%s\">\n"
24- "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n"
25-
26- "<details><summary>%s</summary>\n" /** attach **/
27- "<p>%s: <input type=\"file\" name=\"attach\">\n"
28- "<p>%s: <input type=\"text\" name=\"alt_text\" placeholder=\"[Optional]\">\n"
29- "</details>\n"
30-
31- "<p>"
32- "<details><summary>%s</summary>\n" /** poll **/
33- "<p>%s:<br>\n"
34- "<textarea class=\"snac-textarea\" name=\"poll_options\" "
35- "rows=\"6\" wrap=\"virtual\" placeholder=\"Option 1...\nOption 2...\nOption 3...\n...\"></textarea>\n"
36- "<p><select name=\"poll_multiple\">\n"
37- "<option value=\"off\">%s</option>\n"
38- "<option value=\"on\">%s</option>\n"
39- "</select>\n"
40- "<select name=\"poll_end_secs\" id=\"poll_end_secs\">\n"
41- "<option value=\"300\">%s</option>\n"
42- "<option value=\"3600\" selected>%s</option>\n"
43- "<option value=\"86400\">%s</option>\n"
44- "</select>\n"
45- "</details>\n"
46-
47- "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n"
48- "</form><p>\n"
49- "</details>\n"
50- "</div>\n";
51-
52 char *_tmpl3 =
53 "<details><summary>%s</summary>\n"
54
55@@ -862,26 +824,15 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
56
57 xs_str_cat(s, "<div class=\"snac-top-controls\">\n");
58
59- xs *s1 = xs_fmt(_tmpl,
60- L("New Post..."),
61- snac->actor,
62- L("Sensitive content"),
63- L("Sensitive content description"),
64- L("Only for mentioned people"),
65-
66- L("Attachment..."),
67- L("File"),
68- L("File description"),
69-
70- L("Poll..."),
71- L("Poll options (one per line, up to 8)"),
72- L("One choice"),
73- L("Multiple choices"),
74- L("End in 5 minutes"),
75- L("End in 1 hour"),
76- L("End in 1 day"),
77-
78- L("Post"));
79+ xs_html *new_note = html_note(snac, L("New Post..."),
80+ "new_post_div", "new_post_form",
81+ L("What's on your mind?"), "",
82+ NULL, NULL,
83+ xs_stock_false, "",
84+ xs_stock_false, NULL,
85+ NULL, 1);
86+
87+ xs *s1 = xs_html_render(new_note);
88
89 xs *s2 = NULL;
90