summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-11-23 21:04:11 +0100
committerGravatar default2023-11-23 21:04:11 +0100
commitd2a5a55b95215cf2c7b070f0488141ccb4431aa8 (patch)
treed18988c44179248f0d731a25834809f288f735dd
parentNew function html_note() (still unused). (diff)
downloadsnac2-d2a5a55b95215cf2c7b070f0488141ccb4431aa8.tar.gz
snac2-d2a5a55b95215cf2c7b070f0488141ccb4431aa8.tar.xz
snac2-d2a5a55b95215cf2c7b070f0488141ccb4431aa8.zip
Use html_note() from html_people_list().
-rw-r--r--html.c59
1 files changed, 12 insertions, 47 deletions
diff --git a/html.c b/html.c
index 71ac1bd..97e7129 100644
--- a/html.c
+++ b/html.c
@@ -317,6 +317,7 @@ xs_html *html_note(snac *user, char *summary,
317 xs_html_attr("value", edit_id))); 317 xs_html_attr("value", edit_id)));
318 318
319 xs_html_add(form, 319 xs_html_add(form,
320 xs_html_tag("p", NULL),
320 xs_html_tag("details", 321 xs_html_tag("details",
321 xs_html_tag("summary", 322 xs_html_tag("summary",
322 xs_html_text(L("Attachment..."))), 323 xs_html_text(L("Attachment..."))),
@@ -332,10 +333,12 @@ xs_html *html_note(snac *user, char *summary,
332 /* add poll controls */ 333 /* add poll controls */
333 if (poll) { 334 if (poll) {
334 xs_html_add(form, 335 xs_html_add(form,
336 xs_html_tag("p", NULL),
335 xs_html_tag("details", 337 xs_html_tag("details",
336 xs_html_tag("summary", 338 xs_html_tag("summary",
337 xs_html_text(L("Poll..."))), 339 xs_html_text(L("Poll..."))),
338 xs_html_tag("p", NULL), 340 xs_html_tag("p",
341 xs_html_text(L("Poll options (one per line, up to 8):"))),
339 xs_html_tag("textarea", 342 xs_html_tag("textarea",
340 xs_html_attr("class", "snac-textarea"), 343 xs_html_attr("class", "snac-textarea"),
341 xs_html_attr("name", "poll_options"), 344 xs_html_attr("name", "poll_options"),
@@ -351,6 +354,7 @@ xs_html *html_note(snac *user, char *summary,
351 xs_html_tag("option", 354 xs_html_tag("option",
352 xs_html_attr("value", "on"), 355 xs_html_attr("value", "on"),
353 xs_html_text(L("Multiple choices")))), 356 xs_html_text(L("Multiple choices")))),
357 xs_html_text(" "),
354 xs_html_tag("select", 358 xs_html_tag("select",
355 xs_html_attr("name", "poll_end_secs"), 359 xs_html_attr("name", "poll_end_secs"),
356 xs_html_tag("option", 360 xs_html_tag("option",
@@ -1944,54 +1948,15 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head
1944 1948
1945 /* the post textarea */ 1949 /* the post textarea */
1946 xs *dm_div_id = xs_fmt("%s_%s_dm", md5, t); 1950 xs *dm_div_id = xs_fmt("%s_%s_dm", md5, t);
1947 xs *dm_action = xs_fmt("%s/admin/note", snac->actor);
1948 xs *dm_form_id = xs_fmt("%s_reply_form", md5); 1951 xs *dm_form_id = xs_fmt("%s_reply_form", md5);
1949 1952
1950 xs_html *dm_textarea = xs_html_tag("div", 1953 xs_html *dm_textarea = html_note(snac, "Direct Message...",
1951 xs_html_tag("details", 1954 dm_div_id, dm_form_id,
1952 xs_html_tag("summary", 1955 "", "",
1953 xs_html_text(L("Direct Message..."))), 1956 NULL, actor_id,
1954 xs_html_tag("p", NULL), 1957 xs_stock_false, "",
1955 xs_html_tag("div", 1958 xs_stock_false, NULL,
1956 xs_html_attr("class", "snac-note"), 1959 NULL, 0);
1957 xs_html_attr("id", dm_div_id),
1958 xs_html_tag("form",
1959 xs_html_attr("autocomplete", "off"),
1960 xs_html_attr("method", "post"),
1961 xs_html_attr("action", dm_action),
1962 xs_html_attr("enctype", "multipart/form-data"),
1963 xs_html_attr("id", dm_form_id),
1964 xs_html_tag("textarea",
1965 xs_html_attr("class", "snac-textarea"),
1966 xs_html_attr("name", "content"),
1967 xs_html_attr("rows", "4"),
1968 xs_html_attr("wrap", "virtual"),
1969 xs_html_attr("required", "required"),
1970 xs_html_attr("placeholder", ""),
1971 xs_html_text("")),
1972 xs_html_sctag("input",
1973 xs_html_attr("type", "hidden"),
1974 xs_html_attr("name", "to"),
1975 xs_html_attr("value", actor_id)),
1976 xs_html_tag("p", NULL),
1977 xs_html_tag("details",
1978 xs_html_tag("summary",
1979 xs_html_text(L("Attachment..."))),
1980 xs_html_tag("p", NULL),
1981 xs_html_sctag("input",
1982 xs_html_attr("type", "file"),
1983 xs_html_attr("name", "attach")),
1984 xs_html_sctag("input",
1985 xs_html_attr("type", "text"),
1986 xs_html_attr("name", "alt_text"),
1987 xs_html_attr("placeholder", L("Attachment description")))),
1988 xs_html_tag("p", NULL),
1989 xs_html_sctag("input",
1990 xs_html_attr("type", "submit"),
1991 xs_html_attr("class", "button"),
1992 xs_html_attr("value", L("Post")))),
1993 xs_html_tag("p", NULL))),
1994 xs_html_tag("p", NULL));
1995 1960
1996 xs_html_add(snac_controls, dm_textarea); 1961 xs_html_add(snac_controls, dm_textarea);
1997 1962