diff options
| author | 2023-11-26 19:15:43 +0100 | |
|---|---|---|
| committer | 2023-11-26 19:15:43 +0100 | |
| commit | 6417d238512853bcce53f09454d635e841ec60f8 (patch) | |
| tree | ec0268bc1b5d47ebee6bff0da38e4e178d4ced84 | |
| parent | Convert the 'Operations...' top control to xs_html. (diff) | |
| download | snac2-6417d238512853bcce53f09454d635e841ec60f8.tar.gz snac2-6417d238512853bcce53f09454d635e841ec60f8.tar.xz snac2-6417d238512853bcce53f09454d635e841ec60f8.zip | |
Use html_note() in html_top_controls().
| -rw-r--r-- | html.c | 69 |
1 files changed, 10 insertions, 59 deletions
| @@ -288,7 +288,7 @@ xs_html *html_note(snac *user, char *summary, | |||
| 288 | /* no actor_id; ask for mentioned_only */ | 288 | /* no actor_id; ask for mentioned_only */ |
| 289 | xs_html_add(form, | 289 | xs_html_add(form, |
| 290 | xs_html_tag("p", NULL), | 290 | xs_html_tag("p", NULL), |
| 291 | xs_html_text(L("Only for mentioned people")), | 291 | xs_html_text(L("Only for mentioned people: ")), |
| 292 | xs_html_sctag("input", | 292 | xs_html_sctag("input", |
| 293 | xs_html_attr("type", "checkbox"), | 293 | xs_html_attr("type", "checkbox"), |
| 294 | xs_html_attr("name", "mentioned_only"), | 294 | xs_html_attr("name", "mentioned_only"), |
| @@ -712,44 +712,6 @@ xs_str *html_user_header(snac *snac, xs_str *s, int local) | |||
| 712 | xs_str *html_top_controls(snac *snac, xs_str *s) | 712 | xs_str *html_top_controls(snac *snac, xs_str *s) |
| 713 | /* generates the top controls */ | 713 | /* generates the top controls */ |
| 714 | { | 714 | { |
| 715 | char *_tmpl = | ||
| 716 | "<div class=\"snac-note\">\n" | ||
| 717 | "<details><summary>%s</summary>\n" | ||
| 718 | "<form autocomplete=\"off\" method=\"post\" " | ||
| 719 | "action=\"%s/admin/note\" enctype=\"multipart/form-data\">\n" | ||
| 720 | "<textarea class=\"snac-textarea\" name=\"content\" " | ||
| 721 | "rows=\"8\" wrap=\"virtual\" required=\"required\" placeholder=\"What's on your mind?\"></textarea>\n" | ||
| 722 | "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n" | ||
| 723 | "<p>%s: <input type=\"checkbox\" name=\"sensitive\"> " | ||
| 724 | "<input type=\"text\" name=\"summary\" placeholder=\"%s\">\n" | ||
| 725 | "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n" | ||
| 726 | |||
| 727 | "<details><summary>%s</summary>\n" /** attach **/ | ||
| 728 | "<p>%s: <input type=\"file\" name=\"attach\">\n" | ||
| 729 | "<p>%s: <input type=\"text\" name=\"alt_text\" placeholder=\"[Optional]\">\n" | ||
| 730 | "</details>\n" | ||
| 731 | |||
| 732 | "<p>" | ||
| 733 | "<details><summary>%s</summary>\n" /** poll **/ | ||
| 734 | "<p>%s:<br>\n" | ||
| 735 | "<textarea class=\"snac-textarea\" name=\"poll_options\" " | ||
| 736 | "rows=\"6\" wrap=\"virtual\" placeholder=\"Option 1...\nOption 2...\nOption 3...\n...\"></textarea>\n" | ||
| 737 | "<p><select name=\"poll_multiple\">\n" | ||
| 738 | "<option value=\"off\">%s</option>\n" | ||
| 739 | "<option value=\"on\">%s</option>\n" | ||
| 740 | "</select>\n" | ||
| 741 | "<select name=\"poll_end_secs\" id=\"poll_end_secs\">\n" | ||
| 742 | "<option value=\"300\">%s</option>\n" | ||
| 743 | "<option value=\"3600\" selected>%s</option>\n" | ||
| 744 | "<option value=\"86400\">%s</option>\n" | ||
| 745 | "</select>\n" | ||
| 746 | "</details>\n" | ||
| 747 | |||
| 748 | "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n" | ||
| 749 | "</form><p>\n" | ||
| 750 | "</details>\n" | ||
| 751 | "</div>\n"; | ||
| 752 | |||
| 753 | char *_tmpl3 = | 715 | char *_tmpl3 = |
| 754 | "<details><summary>%s</summary>\n" | 716 | "<details><summary>%s</summary>\n" |
| 755 | 717 | ||
| @@ -862,26 +824,15 @@ xs_str *html_top_controls(snac *snac, xs_str *s) | |||
| 862 | 824 | ||
| 863 | xs_str_cat(s, "<div class=\"snac-top-controls\">\n"); | 825 | xs_str_cat(s, "<div class=\"snac-top-controls\">\n"); |
| 864 | 826 | ||
| 865 | xs *s1 = xs_fmt(_tmpl, | 827 | xs_html *new_note = html_note(snac, L("New Post..."), |
| 866 | L("New Post..."), | 828 | "new_post_div", "new_post_form", |
| 867 | snac->actor, | 829 | L("What's on your mind?"), "", |
| 868 | L("Sensitive content"), | 830 | NULL, NULL, |
| 869 | L("Sensitive content description"), | 831 | xs_stock_false, "", |
| 870 | L("Only for mentioned people"), | 832 | xs_stock_false, NULL, |
| 871 | 833 | NULL, 1); | |
| 872 | L("Attachment..."), | 834 | |
| 873 | L("File"), | 835 | xs *s1 = xs_html_render(new_note); |
| 874 | L("File description"), | ||
| 875 | |||
| 876 | L("Poll..."), | ||
| 877 | L("Poll options (one per line, up to 8)"), | ||
| 878 | L("One choice"), | ||
| 879 | L("Multiple choices"), | ||
| 880 | L("End in 5 minutes"), | ||
| 881 | L("End in 1 hour"), | ||
| 882 | L("End in 1 day"), | ||
| 883 | |||
| 884 | L("Post")); | ||
| 885 | 836 | ||
| 886 | xs *s2 = NULL; | 837 | xs *s2 = NULL; |
| 887 | 838 | ||