commit 1d7619a

default  ·  2023-11-26 17:39:00 +0000 UTC
parent 6be3b06
Started refactoring html_top_controls().
1 files changed,  +9, -5
M html.c
M html.c
+9, -5
 1@@ -750,8 +750,9 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
 2         "<p><input type=\"submit\" class=\"button\" value=\"%s\">\n"
 3         "</form><p>\n"
 4         "</details>\n"
 5-        "</div>\n"
 6+        "</div>\n";
 7 
 8+    char *_tmpl2 =
 9         "<div class=\"snac-top-controls-more\">\n"
10         "<details><summary>%s</summary>\n"
11 
12@@ -764,8 +765,9 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
13         "<input type=\"text\" name=\"id\" required=\"required\" placeholder=\"https://fedi.example.com/bob/...\">\n"
14         "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n"
15         "</form><p>\n"
16-        "</details>\n"
17+        "</details>\n";
18 
19+    char *_tmpl3 =
20         "<details><summary>%s</summary>\n"
21 
22         "<div class=\"snac-user-setup\">\n" /** user setup **/
23@@ -896,16 +898,18 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
24         L("End in 1 hour"),
25         L("End in 1 day"),
26 
27-        L("Post"),
28+        L("Post"));
29 
30+    xs *s2 = xs_fmt(_tmpl2,
31         L("Operations..."),
32 
33         snac->actor,
34         L("Follow"), L("(by URL or user@host)"),
35 
36         snac->actor,
37-        L("Boost"), L("(by URL)"),
38+        L("Boost"), L("(by URL)"));
39 
40+    xs *s3 = xs_fmt(_tmpl3,
41         L("User Settings..."),
42         snac->actor,
43         L("Display name"),
44@@ -938,7 +942,7 @@ xs_str *html_top_controls(snac *snac, xs_str *s)
45         L("Update user info")
46     );
47 
48-    s = xs_str_cat(s, s1);
49+    s = xs_str_cat(s, s1, s2, s3);
50 
51     return s;
52 }