summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/html.c b/html.c
index 2e7f87c..d807f4b 100644
--- a/html.c
+++ b/html.c
@@ -1318,6 +1318,27 @@ xs_html *html_top_controls(snac *user)
1318 xs_html_attr("value", lang))); 1318 xs_html_attr("value", lang)));
1319 } 1319 }
1320 1320
1321 /* timezone */
1322 xs_html *tz_select = xs_html_tag("select",
1323 xs_html_attr("name", "tz"));
1324
1325 xs *tzs = xs_tz_list();
1326 const char *tz;
1327
1328 xs_list_foreach(tzs, tz) {
1329 if (strcmp(tz, user->tz) == 0)
1330 xs_html_add(tz_select,
1331 xs_html_tag("option",
1332 xs_html_text(tz),
1333 xs_html_attr("value", tz),
1334 xs_html_attr("selected", "selected")));
1335 else
1336 xs_html_add(tz_select,
1337 xs_html_tag("option",
1338 xs_html_text(tz),
1339 xs_html_attr("value", tz)));
1340 }
1341
1321 xs *user_setup_action = xs_fmt("%s/admin/user-setup", user->actor); 1342 xs *user_setup_action = xs_fmt("%s/admin/user-setup", user->actor);
1322 1343
1323 xs_html_add(top_controls, 1344 xs_html_add(top_controls,
@@ -1514,6 +1535,11 @@ xs_html *html_top_controls(snac *user)
1514 lang_select), 1535 lang_select),
1515 1536
1516 xs_html_tag("p", 1537 xs_html_tag("p",
1538 xs_html_text(L("Time zone:")),
1539 xs_html_sctag("br", NULL),
1540 tz_select),
1541
1542 xs_html_tag("p",
1517 xs_html_text(L("New password:")), 1543 xs_html_text(L("New password:")),
1518 xs_html_sctag("br", NULL), 1544 xs_html_sctag("br", NULL),
1519 xs_html_sctag("input", 1545 xs_html_sctag("input",
@@ -4755,6 +4781,8 @@ int html_post_handler(const xs_dict *req, const char *q_path,
4755 snac.config = xs_dict_set(snac.config, "show_contact_metrics", xs_stock(XSTYPE_FALSE)); 4781 snac.config = xs_dict_set(snac.config, "show_contact_metrics", xs_stock(XSTYPE_FALSE));
4756 if ((v = xs_dict_get(p_vars, "web_ui_lang")) != NULL) 4782 if ((v = xs_dict_get(p_vars, "web_ui_lang")) != NULL)
4757 snac.config = xs_dict_set(snac.config, "lang", v); 4783 snac.config = xs_dict_set(snac.config, "lang", v);
4784 if ((v = xs_dict_get(p_vars, "tz")) != NULL)
4785 snac.config = xs_dict_set(snac.config, "tz", v);
4758 4786
4759 snac.config = xs_dict_set(snac.config, "latitude", xs_dict_get_def(p_vars, "latitude", "")); 4787 snac.config = xs_dict_set(snac.config, "latitude", xs_dict_get_def(p_vars, "latitude", ""));
4760 snac.config = xs_dict_set(snac.config, "longitude", xs_dict_get_def(p_vars, "longitude", "")); 4788 snac.config = xs_dict_set(snac.config, "longitude", xs_dict_get_def(p_vars, "longitude", ""));