diff options
| author | 2023-11-20 21:46:22 +0100 | |
|---|---|---|
| committer | 2023-11-20 21:46:22 +0100 | |
| commit | 009a1da064f10325ef5ed4a0d097cddc372e0358 (patch) | |
| tree | a002eeadc89c0ca31940e96e232edd937bd11477 /html.c | |
| parent | Some xs_html refactoring. (diff) | |
| download | snac2-009a1da064f10325ef5ed4a0d097cddc372e0358.tar.gz snac2-009a1da064f10325ef5ed4a0d097cddc372e0358.tar.xz snac2-009a1da064f10325ef5ed4a0d097cddc372e0358.zip | |
Refactored part of html_people_list() using xs_html.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 64 |
1 files changed, 44 insertions, 20 deletions
| @@ -1781,26 +1781,50 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head | |||
| 1781 | s = xs_str_cat(s, "</form>\n"); | 1781 | s = xs_str_cat(s, "</form>\n"); |
| 1782 | 1782 | ||
| 1783 | /* the post textarea */ | 1783 | /* the post textarea */ |
| 1784 | xs *s2 = xs_fmt( | 1784 | xs *dm_form_id = xs_fmt("%s_%s_dm", md5, t); |
| 1785 | "<p><details><summary>%s</summary>\n" | 1785 | xs *dm_action = xs_fmt("%s/admin/note", snac->actor); |
| 1786 | "<p><div class=\"snac-note\" id=\"%s_%s_dm\">\n" | 1786 | xs *dm_form_id2 = xs_fmt("%s_reply_form", md5); |
| 1787 | "<form autocomplete=\"off\" method=\"post\" action=\"%s/admin/note\" " | 1787 | |
| 1788 | "enctype=\"multipart/form-data\" id=\"%s_reply_form\">\n" | 1788 | xs_html *dm_textarea = xs_html_tag("div", |
| 1789 | "<textarea class=\"snac-textarea\" name=\"content\" " | 1789 | xs_html_tag("details", |
| 1790 | "rows=\"4\" wrap=\"virtual\" required=\"required\"></textarea>\n" | 1790 | xs_html_tag("summary", |
| 1791 | "<input type=\"hidden\" name=\"to\" value=\"%s\">\n" | 1791 | xs_html_text(L("Direct Message..."))), |
| 1792 | "<p><input type=\"file\" name=\"attach\">\n" | 1792 | xs_html_sctag("p", NULL), |
| 1793 | "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n" | 1793 | xs_html_tag("div", |
| 1794 | "</form><p></div>\n" | 1794 | xs_html_attr("class", "snac-note"), |
| 1795 | "</details><p>\n", | 1795 | xs_html_attr("id", dm_form_id), |
| 1796 | 1796 | xs_html_tag("form", | |
| 1797 | L("Direct Message..."), | 1797 | xs_html_attr("autocomplete", "off"), |
| 1798 | md5, t, | 1798 | xs_html_attr("method", "post"), |
| 1799 | snac->actor, md5, | 1799 | xs_html_attr("action", dm_action), |
| 1800 | actor_id, | 1800 | xs_html_attr("enctype", "multipart/form-data"), |
| 1801 | L("Post") | 1801 | xs_html_attr("id", dm_form_id2), |
| 1802 | ); | 1802 | xs_html_tag("textarea", |
| 1803 | s = xs_str_cat(s, s2); | 1803 | xs_html_attr("class", "snac-textarea"), |
| 1804 | xs_html_attr("name", "content"), | ||
| 1805 | xs_html_attr("rows", "4"), | ||
| 1806 | xs_html_attr("wrap", "virtual"), | ||
| 1807 | xs_html_attr("required", "required")), | ||
| 1808 | xs_html_sctag("input", | ||
| 1809 | xs_html_attr("type", "hidden"), | ||
| 1810 | xs_html_attr("name", "to"), | ||
| 1811 | xs_html_attr("value", actor_id)), | ||
| 1812 | xs_html_sctag("p", NULL), | ||
| 1813 | xs_html_sctag("input", | ||
| 1814 | xs_html_attr("type", "file"), | ||
| 1815 | xs_html_attr("name", "attach")), | ||
| 1816 | xs_html_sctag("p", NULL), | ||
| 1817 | xs_html_sctag("input", | ||
| 1818 | xs_html_attr("type", "submit"), | ||
| 1819 | xs_html_attr("class", "button"), | ||
| 1820 | xs_html_attr("value", L("Post")))), | ||
| 1821 | xs_html_sctag("p", NULL))), | ||
| 1822 | xs_html_sctag("p", NULL)); | ||
| 1823 | |||
| 1824 | { | ||
| 1825 | xs *s1 = xs_html_render(dm_textarea); | ||
| 1826 | s = xs_str_cat(s, s1); | ||
| 1827 | } | ||
| 1804 | 1828 | ||
| 1805 | s = xs_str_cat(s, "</div>\n"); | 1829 | s = xs_str_cat(s, "</div>\n"); |
| 1806 | 1830 | ||