From 6fc748933ad263ba0e8c78eb9ae1e085a2b0dfb2 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Wed, 15 Apr 2026 16:59:19 +0200 Subject: Add neighborhood feature --- html.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'html.c') diff --git a/html.c b/html.c index a3d2c61..4484fc2 100644 --- a/html.c +++ b/html.c @@ -1015,6 +1015,20 @@ static xs_html *html_instance_body(void) xs_html_text(handle))))); } + /* BEGIN neighborhood */ + if (xs_type(xs_dict_get(srv_config, "neighborhood")) == XSTYPE_LIST) { + xs *nurl = xs_fmt("%s/neighborhood", srv_baseurl); + xs_html_add(dl, + xs_html_tag("di", + xs_html_tag("dt", + xs_html_text(L("Neighborhood"))), + xs_html_tag("dd", + xs_html_tag("a", + xs_html_attr("href", nurl), + xs_html_text(L("View federated neighborhood feed")))))); + } + /* END neighborhood */ + return body; } @@ -1207,6 +1221,18 @@ static xs_html *html_user_body(snac *user, int read_only) xs *people_url = xs_fmt("%s/people", user->actor); xs *instance_url = xs_fmt("%s/instance", user->actor); + /* BEGIN neighborhood */ + xs_html *neighborhood_nav = xs_html_text(""); + if (xs_type(xs_dict_get(srv_config, "neighborhood")) == XSTYPE_LIST) { + xs *nurl = xs_fmt("%s/neighborhood", srv_baseurl); + neighborhood_nav = xs_html_container( + xs_html_text(" - "), + xs_html_tag("a", + xs_html_attr("href", nurl), + xs_html_text(L("neighborhood")))); + } + /* END neighborhood */ + xs_html_add(top_nav, xs_html_tag("a", xs_html_attr("href", user->actor), @@ -1229,6 +1255,7 @@ static xs_html *html_user_body(snac *user, int read_only) xs_html_tag("a", xs_html_attr("href", instance_url), xs_html_text(L("instance"))), + neighborhood_nav, xs_html_text(" "), xs_html_tag("form", xs_html_attr("style", "display: inline!important"), -- cgit