summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2023-11-26 18:39:00 +0100
committerGravatar default2023-11-26 18:39:00 +0100
commit1d7619ab832adad0c970c6d16b568cc4078c6e85 (patch)
tree5c8d7457a1e7d1430ec3cd0a32ef071cab5f463a /html.c
parentBackport from xs. (diff)
downloadsnac2-1d7619ab832adad0c970c6d16b568cc4078c6e85.tar.gz
snac2-1d7619ab832adad0c970c6d16b568cc4078c6e85.tar.xz
snac2-1d7619ab832adad0c970c6d16b568cc4078c6e85.zip
Started refactoring html_top_controls().
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/html.c b/html.c
index 8d95738..fe0ef9f 100644
--- a/html.c
+++ b/html.c
@@ -750,8 +750,9 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
750 "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n" 750 "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n"
751 "</form><p>\n" 751 "</form><p>\n"
752 "</details>\n" 752 "</details>\n"
753 "</div>\n" 753 "</div>\n";
754 754
755 char *_tmpl2 =
755 "<div class=\"snac-top-controls-more\">\n" 756 "<div class=\"snac-top-controls-more\">\n"
756 "<details><summary>%s</summary>\n" 757 "<details><summary>%s</summary>\n"
757 758
@@ -764,8 +765,9 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
764 "<input type=\"text\" name=\"id\" required=\"required\" placeholder=\"https://fedi.example.com/bob/...\">\n" 765 "<input type=\"text\" name=\"id\" required=\"required\" placeholder=\"https://fedi.example.com/bob/...\">\n"
765 "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n" 766 "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n"
766 "</form><p>\n" 767 "</form><p>\n"
767 "</details>\n" 768 "</details>\n";
768 769
770 char *_tmpl3 =
769 "<details><summary>%s</summary>\n" 771 "<details><summary>%s</summary>\n"
770 772
771 "<div class=\"snac-user-setup\">\n" /** user setup **/ 773 "<div class=\"snac-user-setup\">\n" /** user setup **/
@@ -896,16 +898,18 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
896 L("End in 1 hour"), 898 L("End in 1 hour"),
897 L("End in 1 day"), 899 L("End in 1 day"),
898 900
899 L("Post"), 901 L("Post"));
900 902
903 xs *s2 = xs_fmt(_tmpl2,
901 L("Operations..."), 904 L("Operations..."),
902 905
903 snac->actor, 906 snac->actor,
904 L("Follow"), L("(by URL or user@host)"), 907 L("Follow"), L("(by URL or user@host)"),
905 908
906 snac->actor, 909 snac->actor,
907 L("Boost"), L("(by URL)"), 910 L("Boost"), L("(by URL)"));
908 911
912 xs *s3 = xs_fmt(_tmpl3,
909 L("User Settings..."), 913 L("User Settings..."),
910 snac->actor, 914 snac->actor,
911 L("Display name"), 915 L("Display name"),
@@ -938,7 +942,7 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
938 L("Update user info") 942 L("Update user info")
939 ); 943 );
940 944
941 s = xs_str_cat(s, s1); 945 s = xs_str_cat(s, s1, s2, s3);
942 946
943 return s; 947 return s;
944} 948}