commit 4e8beaa

default  ·  2023-11-22 11:50:48 +0000 UTC
parent 7236e15
Some xs_html usage in html_notifications().
1 files changed,  +15, -6
M html.c
M html.c
+15, -6
 1@@ -1887,12 +1887,21 @@ xs_str *html_notifications(snac *snac)
 2 
 3     s = html_user_header(snac, s, 0);
 4 
 5-    xs *s1 = xs_fmt(
 6-        "<form autocomplete=\"off\" "
 7-        "method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n"
 8-        "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n"
 9-        "</form><p>\n", snac->actor, L("Clear all"));
10-    s = xs_str_cat(s, s1);
11+    xs *clear_all_action = xs_fmt("%s/admin/clear-notifications", snac->actor);
12+    xs_html *clear_all_form = xs_html_tag("form",
13+        xs_html_attr("autocomplete", "off"),
14+        xs_html_attr("method",       "post"),
15+        xs_html_attr("action",       clear_all_action),
16+        xs_html_attr("id",           "clear"),
17+        xs_html_sctag("input",
18+            xs_html_attr("type",     "submit"),
19+            xs_html_attr("class",    "snac-btn-like"),
20+            xs_html_attr("value",    L("Clear all"))));
21+
22+    {
23+        xs *s1 = xs_html_render(clear_all_form);
24+        s = xs_str_cat(s, s1);
25+    }
26 
27     while (xs_list_iter(&p, &v)) {
28         xs *noti = notify_get(snac, v);