diff options
| author | 2025-01-10 08:12:38 +0100 | |
|---|---|---|
| committer | 2025-01-10 08:12:38 +0100 | |
| commit | ea2eb3299dbb13699cffadb7be445ae87cae00bc (patch) | |
| tree | 6cd0e90fee72ef87c1d59badecd166769afa86f8 /html.c | |
| parent | New user settings latitude and longitude. (diff) | |
| download | snac2-ea2eb3299dbb13699cffadb7be445ae87cae00bc.tar.gz snac2-ea2eb3299dbb13699cffadb7be445ae87cae00bc.tar.xz snac2-ea2eb3299dbb13699cffadb7be445ae87cae00bc.zip | |
Show the location in the public page.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 18 |
1 files changed, 18 insertions, 0 deletions
| @@ -924,6 +924,7 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 924 | xs_html_raw("✔ "), | 924 | xs_html_raw("✔ "), |
| 925 | xs_html_tag("a", | 925 | xs_html_tag("a", |
| 926 | xs_html_attr("rel", "me"), | 926 | xs_html_attr("rel", "me"), |
| 927 | xs_html_attr("target", "_blank"), | ||
| 927 | xs_html_attr("href", v), | 928 | xs_html_attr("href", v), |
| 928 | xs_html_text(v))); | 929 | xs_html_text(v))); |
| 929 | } | 930 | } |
| @@ -960,6 +961,23 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 960 | snac_metadata); | 961 | snac_metadata); |
| 961 | } | 962 | } |
| 962 | 963 | ||
| 964 | const char *latitude = xs_dict_get_def(user->config, "latitude", ""); | ||
| 965 | const char *longitude = xs_dict_get_def(user->config, "longitude", ""); | ||
| 966 | |||
| 967 | if (*latitude && *longitude) { | ||
| 968 | xs *label = xs_fmt(L("%s,%s"), latitude, longitude); | ||
| 969 | xs *url = xs_fmt(L("https://openstreetmap.org/search?query=%s,%s"), | ||
| 970 | latitude, longitude); | ||
| 971 | |||
| 972 | xs_html_add(top_user, | ||
| 973 | xs_html_tag("p", | ||
| 974 | xs_html_text(L("Location: ")), | ||
| 975 | xs_html_tag("a", | ||
| 976 | xs_html_attr("href", url), | ||
| 977 | xs_html_attr("target", "_blank"), | ||
| 978 | xs_html_text(label)))); | ||
| 979 | } | ||
| 980 | |||
| 963 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { | 981 | if (xs_is_true(xs_dict_get(user->config, "show_contact_metrics"))) { |
| 964 | xs *fwers = follower_list(user); | 982 | xs *fwers = follower_list(user); |
| 965 | xs *fwing = following_list(user); | 983 | xs *fwing = following_list(user); |