From 4e8beaab8fdd07b34150e347b72b14ce8d3ed778 Mon Sep 17 00:00:00 2001 From: default Date: Wed, 22 Nov 2023 12:50:48 +0100 Subject: Some xs_html usage in html_notifications(). --- html.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index 6873e5a..daa73ab 100644 --- a/html.c +++ b/html.c @@ -1887,12 +1887,21 @@ xs_str *html_notifications(snac *snac) s = html_user_header(snac, s, 0); - xs *s1 = xs_fmt( - "
\n" - "\n" - "

\n", snac->actor, L("Clear all")); - s = xs_str_cat(s, s1); + xs *clear_all_action = xs_fmt("%s/admin/clear-notifications", snac->actor); + xs_html *clear_all_form = xs_html_tag("form", + xs_html_attr("autocomplete", "off"), + xs_html_attr("method", "post"), + xs_html_attr("action", clear_all_action), + xs_html_attr("id", "clear"), + xs_html_sctag("input", + xs_html_attr("type", "submit"), + xs_html_attr("class", "snac-btn-like"), + xs_html_attr("value", L("Clear all")))); + + { + xs *s1 = xs_html_render(clear_all_form); + s = xs_str_cat(s, s1); + } while (xs_list_iter(&p, &v)) { xs *noti = notify_get(snac, v); -- cgit v1.2.3