Remove dead render_profile_page from federation sx_components
This function was replaced by defpage-based rendering but never deleted. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,47 +144,6 @@ async def render_choose_username_page(ctx: dict) -> str:
|
|||||||
title="Choose Username \u2014 Rose Ash")
|
title="Choose Username \u2014 Rose Ash")
|
||||||
|
|
||||||
|
|
||||||
async def render_profile_page(ctx: dict, actor: Any, activities: list,
|
|
||||||
total: int) -> str:
|
|
||||||
from shared.config import config
|
|
||||||
|
|
||||||
ap_domain = config().get("ap_domain", "rose-ash.com")
|
|
||||||
display_name = actor.display_name or actor.preferred_username
|
|
||||||
summary_sx = sx_call(
|
|
||||||
"federation-profile-summary-text", text=str(escape(actor.summary)),
|
|
||||||
) if actor.summary else ""
|
|
||||||
|
|
||||||
activities_sx = ""
|
|
||||||
if activities:
|
|
||||||
parts = []
|
|
||||||
for a in activities:
|
|
||||||
published = a.published.strftime("%Y-%m-%d %H:%M") if a.published else ""
|
|
||||||
obj_type_sx = sx_call(
|
|
||||||
"federation-activity-obj-type", obj_type=a.object_type,
|
|
||||||
) if a.object_type else ""
|
|
||||||
parts.append(sx_call(
|
|
||||||
"federation-activity-card",
|
|
||||||
activity_type=a.activity_type, published=published,
|
|
||||||
obj_type=SxExpr(obj_type_sx) if obj_type_sx else None,
|
|
||||||
))
|
|
||||||
items_sx = "(<> " + " ".join(parts) + ")"
|
|
||||||
activities_sx = sx_call("federation-activities-list", items=SxExpr(items_sx))
|
|
||||||
else:
|
|
||||||
activities_sx = sx_call("federation-activities-empty")
|
|
||||||
|
|
||||||
content = sx_call(
|
|
||||||
"federation-profile-page",
|
|
||||||
display_name=str(escape(display_name)),
|
|
||||||
username=str(escape(actor.preferred_username)),
|
|
||||||
domain=str(escape(ap_domain)),
|
|
||||||
summary=SxExpr(summary_sx) if summary_sx else None,
|
|
||||||
activities_heading=f"Activities ({total})",
|
|
||||||
activities=SxExpr(activities_sx),
|
|
||||||
)
|
|
||||||
return _social_page(ctx, actor, content=content,
|
|
||||||
title=f"@{actor.preferred_username} \u2014 Rose Ash")
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Public API: Pagination fragment renderers
|
# Public API: Pagination fragment renderers
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user