@@ -62,6 +62,23 @@ def gobar_organizations_with_details(limit: int = 20) -> list[dict[str, Any]]:
6262 return []
6363
6464
65+ def gobar_org_details_by_name () -> dict [str , dict [str , Any ]]:
66+ """Mapa nombre → org (logo, package_count) para el árbol de /organization.
67+
68+ ponytail: all_fields está capado por
69+ ckan.group_and_organization_list_all_fields_max (default 25); con más
70+ organismos que eso, los excedentes se muestran sin logo/count — subir ese
71+ valor en la config si hace falta.
72+ """
73+ try :
74+ orgs = toolkit .get_action ("organization_list" )(
75+ {"ignore_auth" : True }, {"all_fields" : True }
76+ )
77+ return {o ["name" ]: o for o in orgs }
78+ except Exception :
79+ return {}
80+
81+
6582# ── Custom pages helpers ──
6683
6784def gobar_page_list () -> list [dict [str , str ]]:
@@ -325,6 +342,7 @@ def get_helpers() -> dict[str, Any]:
325342 "gobar_group_count" : gobar_group_count ,
326343 "gobar_groups_with_details" : gobar_groups_with_details ,
327344 "gobar_organizations_with_details" : gobar_organizations_with_details ,
345+ "gobar_org_details_by_name" : gobar_org_details_by_name ,
328346 # Custom pages
329347 "gobar_page_list" : gobar_page_list ,
330348 "gobar_get_config" : gobar_get_config ,
0 commit comments