commit a30844b

grunfink  ·  2025-08-12 08:33:48 +0000 UTC
parent 5ae46b2
Show a dropdown with the user configured languages (still unused).
1 files changed,  +25, -0
M html.c
M html.c
+25, -0
 1@@ -458,6 +458,31 @@ xs_html *html_note(snac *user, const char *summary,
 2                 xs_html_attr("name", "is_draft"),
 3                 xs_html_attr(is_draft ? "checked" : "", NULL))));
 4 
 5+    const char *post_langs = xs_dict_get(user->config, "post_langs");
 6+
 7+    if (xs_is_string(post_langs) && *post_langs) {
 8+        xs *ll = xs_split(post_langs, " ");
 9+        const char *lang;
10+
11+        xs_html *post_lang = xs_html_tag("select",
12+            xs_html_attr("name", "post_lang"));
13+
14+        xs_list_foreach(ll, lang) {
15+            if (*lang) {
16+                xs_html_add(post_lang,
17+                    xs_html_tag("option",
18+                        xs_html_text(lang),
19+                        xs_html_attr("value", lang)));
20+            }
21+        }
22+
23+        xs_html_add(form,
24+            xs_html_tag("p", NULL),
25+            xs_html_text(L("Language:")),
26+            xs_html_text(" "),
27+            post_lang);
28+    }
29+
30     /* post date and time */
31     xs *post_date = NULL;
32     xs *post_time = NULL;