package server import ( "net/url" "strings" "pageswiki/internal/store" ) // Names identify Streets only within their parent Quartier. UUID references // remain available for stable identity across renames and moves. func cityDetailHref(kind, name, quartierName, uuid string) string { prefix := map[string]string{"quartier": "q", "street": "s", "spot": "p"}[strings.ToLower(kind)] if prefix == "" { return "/v/city" } ref := "uuid:" + uuid if name != "" && (prefix != "s" || quartierName != "") { ref = url.PathEscape(name) if prefix == "s" { ref = url.PathEscape(quartierName) + "/" + ref } } else { ref = url.PathEscape(ref) } return "/v/city/" + prefix + "/" + ref } func canReadCityNode(node store.CityNodeDetail, allowed func(string) bool) bool { return allowed(node.PathPrefix) && (node.Quartier == nil || allowed(node.Quartier.PathPrefix)) && (node.Street == nil || allowed(node.Street.PathPrefix)) } func cityPageHref(path string) string { return (&url.URL{Path: path}).EscapedPath() } type cityPageView struct { store.CityPagePlacement Href string }