commit 32953e4

grunfink  ·  2026-09-01 13:26:02 +0000 UTC
parent 3b19a50
More text browser friendly things.
1 files changed,  +12, -3
M html.c
M html.c
+12, -3
 1@@ -1465,9 +1465,18 @@ xs_html *html_checkbox(const char *form_name, const char *label, int flag)
 2 }
 3 
 4 
 5-xs_html *html_top_controls(snac *user)
 6+xs_html *html_top_controls(snac *user, int tb_friendly)
 7 /* generates the top controls */
 8 {
 9+    if (tb_friendly) {
10+        /* generate only a link to the /operations entrypoint */
11+        xs *url = xs_fmt("%s/operations", user->actor);
12+
13+        return xs_html_tag("a",
14+            xs_html_attr("href", url),
15+            xs_html_text(L("Operations...")));
16+    }
17+
18     xs *ops_action = xs_fmt("%s/admin/action", user->actor);
19 
20     xs_html *top_controls = xs_html_tag("div",
21@@ -3529,7 +3538,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
22 
23     if (user && !read_only)
24         xs_html_add(body,
25-            html_top_controls(user));
26+            html_top_controls(user, tb_friendly));
27 
28     if (error != NULL) {
29         xs_html_add(body,
30@@ -4887,7 +4896,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
31                 h_body);
32 
33             xs_html_add(h_body,
34-                html_top_controls(&snac),
35+                html_top_controls(&snac, 0),
36                 html_footer(&snac));
37 
38             *body   = xs_html_render_s(html, "<!DOCTYPE html>\n");